Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-39615: Add warnings.warn() skip_file_prefixes support #100840

Merged
merged 3 commits into from Jan 28, 2023

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented Jan 8, 2023

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.

My motivation work finally tackling this feature: It will avoid the hacks around putting the warning in the right place in #100618.

`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.
@gpshead gpshead requested review from brettcannon and merwok Jan 21, 2023
@gpshead gpshead self-assigned this Jan 23, 2023
@gpshead gpshead requested a review from Yhg1s Jan 25, 2023
Lib/test/test_warnings/__init__.py Show resolved Hide resolved
Lib/warnings.py Outdated Show resolved Hide resolved
Lib/warnings.py Outdated Show resolved Hide resolved
@gpshead gpshead merged commit 052f53d into python:main Jan 28, 2023
17 checks passed
@gpshead gpshead deleted the feature/warn/skip branch Jan 28, 2023
Python/_warnings.c Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants