bpo-32230: Set sys.warnoptions with -X dev by vstinner · Pull Request #4820 · python/cpython (original) (raw)
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.