(original) (raw)

changeset: 95223:2a336cc29282 parent: 95220:b0b4c4d365b1 user: Brett Cannon brett@python.org date: Fri Mar 27 12:56:57 2015 -0400 files: Lib/formatter.py Lib/imp.py description: Fix module deprecation warnings to have a useful stacklevel diff -r b0b4c4d365b1 -r 2a336cc29282 Lib/formatter.py --- a/Lib/formatter.py Fri Mar 27 15:42:37 2015 +0100 +++ b/Lib/formatter.py Fri Mar 27 12:56:57 2015 -0400 @@ -21,7 +21,7 @@ import sys import warnings warnings.warn('the formatter module is deprecated and will be removed in ' - 'Python 3.6', DeprecationWarning) + 'Python 3.6', DeprecationWarning, stacklevel=2) AS_IS = None diff -r b0b4c4d365b1 -r 2a336cc29282 Lib/imp.py --- a/Lib/imp.py Fri Mar 27 15:42:37 2015 +0100 +++ b/Lib/imp.py Fri Mar 27 12:56:57 2015 -0400 @@ -29,7 +29,7 @@ warnings.warn("the imp module is deprecated in favour of importlib; " "see the module's documentation for alternative uses", - PendingDeprecationWarning) + PendingDeprecationWarning, stacklevel=2) # DEPRECATED SEARCH_ERROR = 0 /brett@python.org