changeset: 96212:666e5b554f32 user: Yury Selivanov date: Fri May 22 16:09:44 2015 -0400 files: Lib/inspect.py description: Issue 20438: Adjust stacklevel of inspect.getargspec() warning. diff -r 3e96d7ca3f51 -r 666e5b554f32 Lib/inspect.py --- a/Lib/inspect.py Fri May 22 10:14:11 2015 -0700 +++ b/Lib/inspect.py Fri May 22 16:09:44 2015 -0400 @@ -1034,7 +1034,8 @@ 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: