@@ -391,9 +391,6 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
391391 usage ("-T and -j don't go together!" )
392392 if use_mp and findleaks :
393393 usage ("-l and -j don't go together!" )
394- if use_mp and max (sys .flags ):
395- # TODO: inherit the environment and the flags
396- print ("Warning: flags and environment variables are ignored with -j option" )
397394
398395 good = []
399396 bad = []
@@ -534,6 +531,8 @@ def tests_and_args():
534531 )
535532 yield (test , args_tuple )
536533 pending = tests_and_args ()
534+ opt_args = support .args_from_interpreter_flags ()
535+ base_cmd = [sys .executable ] + opt_args + ['-m' , 'test.regrtest' ]
537536 def work ():
538537 # A worker thread.
539538 try :
@@ -544,8 +543,7 @@ def work():
544543 output .put ((None , None , None , None ))
545544 return
546545 # -E is needed by some tests, e.g. test_import
547- popen = Popen ([sys .executable , '-E' , '-m' , 'test.regrtest' ,
548- '--slaveargs' , json .dumps (args_tuple )],
546+ popen = Popen (base_cmd + ['--slaveargs' , json .dumps (args_tuple )],
549547 stdout = PIPE , stderr = PIPE ,
550548 universal_newlines = True ,
551549 close_fds = (os .name != 'nt' ))
0 commit comments