Updated docstring
authorThierry Florac <thierry.florac@onf.fr>
Mon, 19 Jun 2017 16:24:22 +0200
changeset 95 f6cc362670a6
parent 94 39095d40c406
child 96 a543685e0ca1
Updated docstring
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