mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
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.
This commit is contained in:
parent
f39b674876
commit
09f3a8a124
7 changed files with 97 additions and 39 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue