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

bpo-32230: Set sys.warnoptions with -X dev #4820

Merged
merged 1 commit into from
Dec 12, 2017
Merged

bpo-32230: Set sys.warnoptions with -X dev #4820

merged 1 commit into from
Dec 12, 2017

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Dec 12, 2017

Rather than supporting dev mode directly in the warnings module, this
instead adjusts the initialisation code to add an extra 'default'
entry to sys.warnoptions when dev mode is enabled.

This ensures that dev mode behaves exactly as if -Wdefault had
been passed on the command line, including in the way it interacts
with sys.warnoptions, and with other command line flags like -bb.

Fix also bpo-20361: have -b & -bb options take precedence over any
other warnings options.

https://bugs.python.org/issue32230

Rather than supporting dev mode directly in the warnings module, this
instead adjusts the initialisation code to add an extra 'default'
entry to sys.warnoptions when dev mode is enabled.

This ensures that dev mode behaves *exactly* as if `-Wdefault` had
been passed on the command line, including in the way it interacts
with `sys.warnoptions`, and with other command line flags like `-bb`.

Fix also bpo-20361: have -b & -bb options take precedence over any
other warnings options.
@vstinner
Copy link
Member Author

This PR is the modified version of Nick's PR #4734, see my comment: #4734 (comment)

@vstinner vstinner merged commit 747f48e into python:master Dec 12, 2017
@vstinner vstinner deleted the xdev_warnoptions branch December 12, 2017 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants