# HG changeset patch # User Thierry Florac # Date 1497882262 -7200 # Node ID f6cc362670a6f45cf8a04c14f496f27bae718493 # Parent 39095d40c406929f96ebaeeb648e26e8443af5a7 Updated docstring diff -r 39095d40c406 -r f6cc362670a6 src/pyams_utils/decorator.py --- a/src/pyams_utils/decorator.py Mon Jun 19 16:05:08 2017 +0200 +++ b/src/pyams_utils/decorator.py Mon Jun 19 16:24:22 2017 +0200 @@ -23,9 +23,9 @@ def deprecated(*msg): - """This is a decorator which can be used to mark functions - as deprecated. It will result in a warning being emitted - when the function is used. + """This is a decorator which can be used to mark functions as deprecated. + + It will result in a warning being emitted when the function is used. """ def decorator(func): @@ -34,8 +34,8 @@ def new_func(*args, **kwargs): warnings.warn_explicit("Function %s is deprecated. %s" % (func.__name__, message), category=DeprecationWarning, - filename=func.func_code.co_filename, - lineno=func.func_code.co_firstlineno + 1) + filename=func.__code__.co_filename, + lineno=func.__code__.co_firstlineno + 1) return func(*args, **kwargs) return new_func