Mercurial > cpython-lru_cache-weakref
diff Lib/test/support.py @ 68531:07f5ec8fc014
Add warnings support to test.support.args_from_interpreter_flags().
This allows the -j flag to regrtest to propagate warnings settings
properly.
| author | Brett Cannon <brett@python.org> |
|---|---|
| date | Tue, 15 Mar 2011 16:03:09 -0400 |
| parents | b39270c6b8d1 |
| children | 91744654e109 |
line wrap: on
line diff
--- a/Lib/test/support.py Tue Mar 15 15:55:12 2011 -0400 +++ b/Lib/test/support.py Tue Mar 15 16:03:09 2011 -0400 @@ -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 #============================================================
