diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-11-21 01:32:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-21 01:32:40 (GMT) |
commit | 09f3a8a1249308a104a89041d82fe99e6c087043 (patch) | |
tree | 2d494c186b4aadfb6fe630f8ac9fc7e66e1906f5 /Modules/main.c | |
parent | f39b674876d2bd47ec7fc106d673b60ff24092ca (diff) | |
download | cpython-09f3a8a1249308a104a89041d82fe99e6c087043.zip cpython-09f3a8a1249308a104a89041d82fe99e6c087043.tar.gz cpython-09f3a8a1249308a104a89041d82fe99e6c087043.tar.bz2 |
bpo-32089: Fix warnings filters in dev mode (#4482)
The developer mode (-X dev) now creates all default warnings filters
to order filters in the correct order to always show ResourceWarning
and make BytesWarning depend on the -b option.
Write a functional test to make sure that ResourceWarning is logged
twice at the same location in the developer mode.
Add a new 'dev_mode' field to _PyCoreConfig.
Diffstat (limited to 'Modules/main.c')
-rw-r--r-- | Modules/main.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Modules/main.c b/Modules/main.c index 203abf4..70c1c3d 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -1397,14 +1397,9 @@ pymain_parse_envvars(_PyMain *pymain) return -1; } if (pymain_get_xoption(pymain, L"dev")) { - /* "python3 -X dev ..." behaves - as "PYTHONMALLOC=debug python3 -Wd -X faulthandler ..." */ - core_config->allocator = "debug"; - if (pymain_optlist_append(pymain, &pymain->cmdline.warning_options, - L"default") < 0) { - return -1; - } + core_config->dev_mode = 1; core_config->faulthandler = 1; + core_config->allocator = "debug"; } return 0; } |