Issue 20438: Adjust stacklevel of inspect.getargspec() warning.

This commit is contained in:
Yury Selivanov 2015-05-22 16:09:44 -04:00
parent 46dbb7d103
commit c8386f78fd
1 changed files with 2 additions and 1 deletions

View 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: