]> granicus.if.org Git - python/commitdiff
Issue 20438: Adjust stacklevel of inspect.getargspec() warning.
authorYury Selivanov <yselivanov@sprymix.com>
Fri, 22 May 2015 20:09:44 +0000 (16:09 -0400)
committerYury Selivanov <yselivanov@sprymix.com>
Fri, 22 May 2015 20:09:44 +0000 (16:09 -0400)
Lib/inspect.py

index 48354f6d618ca2caaedb9b261b26ab3d2e56c39f..3debc24e4f25c4971596281d8940ef4080718c15 100644 (file)
@@ -1034,7 +1034,8 @@ def getargspec(func):
     if the func has either annotations or keyword arguments.
     """
     warnings.warn("inspect.getargspec() is deprecated, "
-                  "use inspect.signature() instead", DeprecationWarning)
+                  "use inspect.signature() instead", DeprecationWarning,
+                  stacklevel=2)
     args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \
         getfullargspec(func)
     if kwonlyargs or ann: