Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def none_decorator(func):
- """Decorator that prevents execution if the only parameter supplied is
- None.
- :func: The function being decorated.
- :returns: Return value of the function being decorated.
- """
- def none_deco(*args):
- if len(sys.argv) > 1:
- return func(*args)
- return none_deco
Advertisement
Add Comment
Please, Sign In to add comment