mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #24305: Prevent import subsystem stack frames from being counted
by the warnings.warn(stacklevel=) parameter.
This commit is contained in:
parent
62b24624dd
commit
714e49371b
7 changed files with 127 additions and 16 deletions
9
Lib/test/test_warnings/data/stacklevel.py
Normal file
9
Lib/test/test_warnings/data/stacklevel.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Helper module for testing the skipmodules argument of warnings.warn()
|
||||
|
||||
import warnings
|
||||
|
||||
def outer(message, stacklevel=1):
|
||||
inner(message, stacklevel)
|
||||
|
||||
def inner(message, stacklevel=1):
|
||||
warnings.warn(message, stacklevel=stacklevel)
|
Loading…
Add table
Add a link
Reference in a new issue