A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2015-September/141752.html below:

[Python-Dev] Make stacklevel=2 by default in warnings.warn()

[Python-Dev] Make stacklevel=2 by default in warnings.warn() [Python-Dev] Make stacklevel=2 by default in warnings.warn()Serhiy Storchaka storchaka at gmail.com
Mon Sep 21 20:23:27 CEST 2015
On 21.09.15 20:00, Serhiy Storchaka wrote:
> On 21.09.15 10:18, Victor Stinner wrote:
>> ---
>> sys:1: UserWarning: here
>> ---
>>
>> "sys:1" is not really useful :-/
>
> This is not new. The same output we get when run a module that correctly
> emits a warning at module level (with explicit stacklevel=2).
>
> $ ./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
>
> If this message looks confusing for you, we can avoid it if stop
> skipping frames further if frame.f_back is None. This will got rid of
> "sys:1:" in both cases, explicit and implicit stacklevel=2.

The patch is provided in http://bugs.python.org/issue25204.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4