Skip to content

Commit c2e51a9

Browse files
[3.11] gh-105436: Ignore unrelated errors when checking empty env (GH-105742) (#105757)
gh-105436: Ignore unrelated errors when checking empty env (GH-105742) (cherry picked from commit 4cefe3c) Co-authored-by: Steve Dower <[email protected]>
1 parent 2b1745f commit c2e51a9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/test/test_subprocess.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,9 +1693,10 @@ def test_run_with_pathlike_path_and_arguments(self):
16931693
@unittest.skipUnless(mswindows, "Maybe test trigger a leak on Ubuntu")
16941694
def test_run_with_an_empty_env(self):
16951695
# gh-105436: fix subprocess.run(..., env={}) broken on Windows
1696-
args = [sys.executable, "-c", 'import sys; sys.exit(57)']
1697-
res = subprocess.run(args, env={})
1698-
self.assertEqual(res.returncode, 57)
1696+
args = [sys.executable, "-c", 'pass']
1697+
# Ignore subprocess errors - we only care that the API doesn't
1698+
# raise an OSError
1699+
subprocess.run(args, env={})
16991700

17001701
def test_capture_output(self):
17011702
cp = self.run_python(("import sys;"

0 commit comments

Comments
 (0)