[issue25204] Confusing (?) warning when run deprecated module as script

2015-09-21 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

$ ./python -Wa Lib/imp.py
sys:1: PendingDeprecationWarning: the imp module is deprecated in favour of 
importlib; see the module's documentation for alternative uses

"sys:1:" is output when the stacklevel argument is larger then the deep of the 
stack.

Following patch stops raising just below the surface.

$ ./python -Wa Lib/imp.py
Lib/imp.py:33: PendingDeprecationWarning: the imp module is deprecated in 
favour of importlib; see the module's documentation for alternative uses
  PendingDeprecationWarning, stacklevel=2)

However I'm not sure that the current behavior is incorrect.

--
components: Extension Modules, Library (Lib)
files: warnings_surface.patch
keywords: patch
messages: 251247
nosy: brett.cannon, eric.snow, haypo, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Confusing (?) warning when run deprecated module as script
Added file: http://bugs.python.org/file40536/warnings_surface.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25204] Confusing (?) warning when run deprecated module as script

2015-09-21 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com