cpython/Lib/test/test_warnings/data/import_warning.py
Larry Hastings 714e49371b Issue #24305: Prevent import subsystem stack frames from being counted
by the warnings.warn(stacklevel=) parameter.
2015-09-06 00:39:37 -07:00

3 lines
No EOL
88 B
Python

import warnings
warnings.warn('module-level warning', DeprecationWarning, stacklevel=2)