[Python-checkins] cpython: Add warnings support to test.support.args_from_interpreter_flags().
brett.cannon
python-checkins at python.org
Tue Mar 15 21:03:42 CET 2011
http://hg.python.org/cpython/rev/07f5ec8fc014
changeset: 68531:07f5ec8fc014
user: Brett Cannon <brett at python.org>
date: Tue Mar 15 16:03:09 2011 -0400
summary:
Add warnings support to test.support.args_from_interpreter_flags().
This allows the -j flag to regrtest to propagate warnings settings
properly.
files:
Lib/test/support.py
diff --git a/Lib/test/support.py b/Lib/test/support.py
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -1374,7 +1374,7 @@
def args_from_interpreter_flags():
"""Return a list of command-line arguments reproducing the current
- settings in sys.flags."""
+ settings in sys.flags and sys.warnoptions."""
flag_opt_map = {
'bytes_warning': 'b',
'dont_write_bytecode': 'B',
@@ -1389,6 +1389,9 @@
v = getattr(sys.flags, flag)
if v > 0:
args.append('-' + opt * v)
+ if sys.warnoptions:
+ args.append('-W')
+ args.extend(sys.warnoptions)
return args
#============================================================
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list