cpython: 2a336cc29282 (original) (raw)
Mercurial > cpython
changeset 95223:2a336cc29282
Fix module deprecation warnings to have a useful stacklevel
Brett Cannon brett@python.org | |
---|---|
date | Fri, 27 Mar 2015 12:56:57 -0400 |
parents | b0b4c4d365b1 |
children | 40a3eb51611b |
files | Lib/formatter.py Lib/imp.py |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-)[+] [-] Lib/formatter.py 2 Lib/imp.py 2 |
line wrap: on
line diff
--- a/Lib/formatter.py +++ b/Lib/formatter.py @@ -21,7 +21,7 @@ manage and inserting data into the outpu import sys import warnings warnings.warn('the formatter module is deprecated and will be removed in '
'Python 3.6', DeprecationWarning)[](#l1.7)
'Python 3.6', DeprecationWarning, stacklevel=2)[](#l1.8)
--- a/Lib/imp.py +++ b/Lib/imp.py @@ -29,7 +29,7 @@ import warnings warnings.warn("the imp module is deprecated in favour of importlib; " "see the module's documentation for alternative uses",
PendingDeprecationWarning)[](#l2.7)
PendingDeprecationWarning, stacklevel=2)[](#l2.8)