Merged revisions 85469 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85469 | antoine.pitrou | 2010-10-14 13:12:00 +0200 (jeu., 14 oct. 2010) | 3 lines

  Inherit interpreter flags in parallel testing
........
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index fc0e823..2cc9700 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -365,9 +365,6 @@
         usage(2, "-T and -j don't go together!")
     if use_mp and findleaks:
         usage(2, "-l and -j don't go together!")
-    if use_mp and max(sys.flags):
-        # TODO: inherit the environment and the flags
-        print "Warning: flags and environment variables are ignored with -j option"
 
     good = []
     bad = []
@@ -496,6 +493,8 @@
                 )
                 yield (test, args_tuple)
         pending = tests_and_args()
+        opt_args = test_support.args_from_interpreter_flags()
+        base_cmd = [sys.executable] + opt_args + ['-m', 'test.regrtest']
         def work():
             # A worker thread.
             try:
@@ -506,8 +505,7 @@
                         output.put((None, None, None, None))
                         return
                     # -E is needed by some tests, e.g. test_import
-                    popen = Popen([sys.executable, '-E', '-m', 'test.regrtest',
-                                   '--slaveargs', json.dumps(args_tuple)],
+                    popen = Popen(base_cmd + ['--slaveargs', json.dumps(args_tuple)],
                                    stdout=PIPE, stderr=PIPE,
                                    universal_newlines=True,
                                    close_fds=(os.name != 'nt'))