Skip to content

Commit 2a8a5a2

Browse files
committed
gh-143309: fix test_execve_env_concurrent_mutation_with_fspath_posix buildbot failure
1 parent 6116d70 commit 2a8a5a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/test/test_os/test_os.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,6 +2627,8 @@ def test_execve_invalid_env(self):
26272627
# See https://github.com/python/cpython/issues/137934 and the other
26282628
# related issues for the reason why we cannot test this on Windows.
26292629
@unittest.skipIf(os.name == "nt", "POSIX-specific test")
2630+
@unittest.skipUnless(unix_shell and os.path.exists(unix_shell),
2631+
"requires a shell")
26302632
def test_execve_env_concurrent_mutation_with_fspath_posix(self):
26312633
# Prevent crash when mutating environment during parsing.
26322634
# Regression test for https://github.com/python/cpython/issues/143309.
@@ -2648,9 +2650,9 @@ def __len__(self): return 1
26482650
def keys(self): return KEYS
26492651
def values(self): return VALUES
26502652
2651-
args = [sys.executable, '-c', "print({message!r})"]
2653+
args = [{unix_shell!r}, '-c', 'echo \"{message!s}\"']
26522654
os.execve(args[0], args, MyEnv())
2653-
""".format(message=message)
2655+
""".format(unix_shell=unix_shell, message=message)
26542656

26552657
# Use '__cleanenv' to signal to assert_python_ok() not
26562658
# to do a copy of os.environ on its own.

0 commit comments

Comments
 (0)