diff options
author | 2017-11-20 17:32:40 -0800 | |
---|---|---|
committer | 2017-11-20 17:32:40 -0800 | |
commit | 09f3a8a1249308a104a89041d82fe99e6c087043 (patch) | |
tree | 2d494c186b4aadfb6fe630f8ac9fc7e66e1906f5 /Lib/subprocess.py | |
parent | bpo-32094: Update subprocess for -X dev (#4480) (diff) | |
download | cpython-09f3a8a1249308a104a89041d82fe99e6c087043.tar.gz cpython-09f3a8a1249308a104a89041d82fe99e6c087043.tar.bz2 cpython-09f3a8a1249308a104a89041d82fe99e6c087043.zip |
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 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 97b449365ef..35bfddde4e9 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -262,15 +262,11 @@ def _args_from_interpreter_flags(): args.append('-' + opt * v) # -W options - warnoptions = sys.warnoptions - xoptions = getattr(sys, '_xoptions', {}) - if 'dev' in xoptions and warnoptions and warnoptions[-1] == 'default': - # special case: -X dev adds 'default' to sys.warnoptions - warnoptions = warnoptions[:-1] - for opt in warnoptions: + for opt in sys.warnoptions: args.append('-W' + opt) # -X options + xoptions = getattr(sys, '_xoptions', {}) if 'dev' in xoptions: args.extend(('-X', 'dev')) for opt in ('faulthandler', 'tracemalloc', 'importtime', |