diff options
Diffstat (limited to 'Lib/test/libregrtest/worker.py')
-rw-r--r-- | Lib/test/libregrtest/worker.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/libregrtest/worker.py b/Lib/test/libregrtest/worker.py index 610e0a8..67f26cf 100644 --- a/Lib/test/libregrtest/worker.py +++ b/Lib/test/libregrtest/worker.py @@ -22,11 +22,15 @@ def create_worker_process(runtests: RunTests, output_fd: int, python_cmd = runtests.python_cmd worker_json = runtests.as_json() + python_opts = support.args_from_interpreter_flags() if python_cmd is not None: executable = python_cmd + # Remove -E option, since --python=COMMAND can set PYTHON environment + # variables, such as PYTHONPATH, in the worker process. + python_opts = [opt for opt in python_opts if opt != "-E"] else: executable = (sys.executable,) - cmd = [*executable, *support.args_from_interpreter_flags(), + cmd = [*executable, *python_opts, '-u', # Unbuffered stdout and stderr '-m', 'test.libregrtest.worker', worker_json] |