]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-39615: Add warnings.warn() skip_file_prefixes support (#100840)
authorGregory P. Smith <greg@krypto.org>
Sat, 28 Jan 2023 02:35:14 +0000 (18:35 -0800)
committerGitHub <noreply@github.com>
Sat, 28 Jan 2023 02:35:14 +0000 (18:35 -0800)
commit052f53d65d9f65c7c3223a383857ad07a182c2d7
tree4d0a6ee4c3026972d1bb01017e50ef8072cd1fe1
parent8cef9c0f92720f6810be1c74e00f611acb4b8b1e
gh-39615: Add warnings.warn() skip_file_prefixes support (#100840)

`warnings.warn()` gains the ability to skip stack frames based on code
filename prefix rather than only a numeric `stacklevel=` via a new
`skip_file_prefixes=` keyword argument.
12 files changed:
Doc/library/warnings.rst
Include/internal/pycore_global_objects_fini_generated.h
Include/internal/pycore_global_strings.h
Include/internal/pycore_runtime_init_generated.h
Include/internal/pycore_unicodeobject_generated.h
Lib/test/test_warnings/__init__.py
Lib/test/test_warnings/data/package_helper.py [new file with mode: 0644]
Lib/test/test_warnings/data/stacklevel.py
Lib/warnings.py
Misc/NEWS.d/next/Library/2023-01-08-00-12-44.gh-issue-39615.gn4PhB.rst [new file with mode: 0644]
Python/_warnings.c
Python/clinic/_warnings.c.h