From: Yury Selivanov Date: Fri, 22 May 2015 20:09:44 +0000 (-0400) Subject: Issue 20438: Adjust stacklevel of inspect.getargspec() warning. X-Git-Tag: v3.5.0b1~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8386f78fdf68fef4d9b87e7147b6d288213b8e4;p=python Issue 20438: Adjust stacklevel of inspect.getargspec() warning. --- diff --git a/Lib/inspect.py b/Lib/inspect.py index 48354f6d61..3debc24e4f 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -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: