Skip to content

Commit

Permalink
fix log_decorator for functions without arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-klein committed Apr 17, 2018
1 parent f155140 commit 281936d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def wrapper(*args, **kwargs):
# call the function and get the return value
ret = func(*args, **kwargs)
# define the string for the function call (include class name for methods)
is_method = hasattr(args[0].__class__, func.__name__)
is_method = args and hasattr(args[0].__class__, func.__name__)
parent = args[0].__class__.__name__ if is_method \
else func.__module__.replace('resources.lib.', '')
func_str = '{0}.{1}'.format(parent, func.__name__)
Expand Down

0 comments on commit 281936d

Please sign in to comment.