[Python-checkins] cpython: Issue 20438: Adjust stacklevel of inspect.getargspec() warning.
yury.selivanov
python-checkins at python.org
Fri May 22 22:09:54 CEST 2015
https://hg.python.org/cpython/rev/666e5b554f32
changeset: 96212:666e5b554f32
user: Yury Selivanov <yselivanov at sprymix.com>
date: Fri May 22 16:09:44 2015 -0400
summary:
Issue 20438: Adjust stacklevel of inspect.getargspec() warning.
files:
Lib/inspect.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Lib/inspect.py b/Lib/inspect.py
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -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:
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list