Skip to content

Commit 4cefe3c

Browse files
authored
gh-105436: Ignore unrelated errors when checking empty env (GH-105742)
1 parent 457a459 commit 4cefe3c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: Lib/test/test_subprocess.py

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

17021703
def test_capture_output(self):
17031704
cp = self.run_python(("import sys;"

0 commit comments

Comments
 (0)