]> granicus.if.org Git - python/commitdiff
MNT: set stacklevel in the getfullargspec deprecation warning to 2 (GH-13029)
authorThomas A Caswell <tcaswell@gmail.com>
Wed, 1 May 2019 15:12:35 +0000 (11:12 -0400)
committerPablo Galindo <Pablogsal@gmail.com>
Wed, 1 May 2019 15:12:34 +0000 (11:12 -0400)
This is consistent with the rest of the `warnings.warn` usage in the
inspect.py module and aids identifying code that needs to be fixed.

This warning came in via d5d2b4546939b98244708e5bb0cfccd55b99d244

Lib/inspect.py

index fffca22357a92817dc5fa6e36f531f421df70487..c460309bb5a1b65778169f53c815029d0f5da607 100644 (file)
@@ -1112,7 +1112,7 @@ def getfullargspec(func):
     """
 
     warnings.warn("Use inspect.signature() instead of inspect.getfullargspec()",
-                  DeprecationWarning)
+                  DeprecationWarning, stacklevel=2)
     try:
         # Re: `skip_bound_arg=False`
         #