mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-41385: Fix test_executable_without_cwd on Windows (GH-21608)
This commit is contained in:
parent
f117cef25b
commit
b1a87300a0
1 changed files with 4 additions and 2 deletions
|
|
@ -376,7 +376,9 @@ class ProcessTestCase(BaseTestCase):
|
|||
# matches *expected_cwd*.
|
||||
p = subprocess.Popen([python_arg, "-c",
|
||||
"import os, sys; "
|
||||
"sys.stdout.write(os.getcwd()); "
|
||||
"buf = sys.stdout.buffer; "
|
||||
"buf.write(os.getcwd().encode()); "
|
||||
"buf.flush(); "
|
||||
"sys.exit(47)"],
|
||||
stdout=subprocess.PIPE,
|
||||
**kwargs)
|
||||
|
|
@ -385,7 +387,7 @@ class ProcessTestCase(BaseTestCase):
|
|||
self.assertEqual(47, p.returncode)
|
||||
normcase = os.path.normcase
|
||||
self.assertEqual(normcase(expected_cwd),
|
||||
normcase(p.stdout.read().decode("utf-8")))
|
||||
normcase(p.stdout.read().decode()))
|
||||
|
||||
def test_cwd(self):
|
||||
# Check that cwd changes the cwd for the child process.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue