gh-114272: Fix or skip tests that fail due to spaces in paths (GH-114451)

This commit is contained in:
Steve Dower 2024-01-25 00:38:34 +00:00 committed by GitHub
parent d5c21c12c1
commit c63c6142f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 25 deletions

View file

@ -4596,8 +4596,11 @@ class FDInheritanceTests(unittest.TestCase):
with open(filename, "w") as fp:
print(code, file=fp, end="")
cmd = [sys.executable, filename]
exitcode = os.spawnl(os.P_WAIT, cmd[0], *cmd)
executable = sys.executable
cmd = [executable, filename]
if os.name == "nt" and " " in cmd[0]:
cmd[0] = f'"{cmd[0]}"'
exitcode = os.spawnl(os.P_WAIT, executable, *cmd)
self.assertEqual(exitcode, 0)