mirror of
https://github.com/python/cpython.git
synced 2024-11-23 18:04:37 +08:00
Fix module deprecation warnings to have a useful stacklevel
This commit is contained in:
parent
79644f9c83
commit
781692ff6a
@ -21,7 +21,7 @@ manage and inserting data into the output.
|
||||
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
|
||||
|
@ -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)
|
||||
PendingDeprecationWarning, stacklevel=2)
|
||||
|
||||
# DEPRECATED
|
||||
SEARCH_ERROR = 0
|
||||
|
Loading…
Reference in New Issue
Block a user