Skip to content

Commit

Permalink
Inherit PYTHONPATH when spawning workers.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjni committed Nov 21, 2022
1 parent a422732 commit 6275ec0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyperf/_utils.py
Expand Up @@ -279,7 +279,7 @@ def create_environ(inherit_environ, locale, copy_all):
return os.environ
env = {}

copy_env = ["PATH", "HOME", "TEMP", "COMSPEC", "SystemRoot", "SystemDrive"]
copy_env = ["PATH", "PYTHONPATH", "HOME", "TEMP", "COMSPEC", "SystemRoot", "SystemDrive"]
if locale:
copy_env.extend(('LANG', 'LC_ADDRESS', 'LC_ALL', 'LC_COLLATE',
'LC_CTYPE', 'LC_IDENTIFICATION', 'LC_MEASUREMENT',
Expand Down
2 changes: 1 addition & 1 deletion pyperf/tests/test_examples.py
Expand Up @@ -27,7 +27,7 @@ def check_command(self, script, args, nproc=3):
self.TESTED.add(script)
script = os.path.join(EXAMPLES_DIR, script)

cmd = [sys.executable] + [script] + args + ["--inherit-env=PYTHONPATH"]
cmd = [sys.executable] + [script] + args
proc = tests.get_output(cmd)

self.assertRegex(proc.stdout,
Expand Down
3 changes: 1 addition & 2 deletions pyperf/tests/test_timeit.py
Expand Up @@ -237,8 +237,7 @@ def test_python_option(self):

# Run benchmark to check if --python works
args = ('--metadata',
'--python', tmp_exe,
'--inherit-env', 'PYTHONPATH')
'--python', tmp_exe)
args = PERF_TIMEIT + args + FAST_BENCH_ARGS
cmd = tests.get_output(args, env=env)
finally:
Expand Down

0 comments on commit 6275ec0

Please sign in to comment.