Skip to content

Commit 6202904

Browse files
committed
fortify invokation of assert_python_ok
1 parent a7a572c commit 6202904

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/test/test_os/test_os.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2656,7 +2656,9 @@ def values(self): return VALUES
26562656
os.execve(args[0], args, MyEnv())
26572657
""".format(message=message)
26582658

2659-
rc, out, _ = assert_python_ok('-c', code)
2659+
# Use '__cleanenv' to signal to assert_python_ok() not
2660+
# to do a copy of os.environ on its own.
2661+
rc, out, _ = assert_python_ok('-c', code, __cleanenv=True)
26602662
self.assertEqual(rc, 0)
26612663
self.assertIn(bytes(message, "ascii"), out)
26622664

0 commit comments

Comments
 (0)