Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8386f7

Browse files
committed
Issue 20438: Adjust stacklevel of inspect.getargspec() warning.
1 parent 46dbb7d commit c8386f7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/inspect.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,8 @@ def getargspec(func):
10341034
if the func has either annotations or keyword arguments.
10351035
"""
10361036
warnings.warn("inspect.getargspec() is deprecated, "
1037-
"use inspect.signature() instead", DeprecationWarning)
1037+
"use inspect.signature() instead", DeprecationWarning,
1038+
stacklevel=2)
10381039
args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \
10391040
getfullargspec(func)
10401041
if kwonlyargs or ann:

0 commit comments

Comments
 (0)