summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_subprocess.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_subprocess.py')
-rw-r--r--Lib/test/test_asyncio/test_subprocess.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
index 859d293..808b21c 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -207,7 +207,7 @@ class SubprocessMixin:
def test_kill_issue43884(self):
if sys.platform == 'win32':
- blocking_shell_command = f'{sys.executable} -c "import time; time.sleep(2)"'
+ blocking_shell_command = f'"{sys.executable}" -c "import time; time.sleep(2)"'
else:
blocking_shell_command = 'sleep 1; sleep 1'
creationflags = 0
@@ -745,7 +745,10 @@ class SubprocessMixin:
def test_create_subprocess_env_shell(self) -> None:
async def main() -> None:
- cmd = f'''{sys.executable} -c "import os, sys; sys.stdout.write(os.getenv('FOO'))"'''
+ executable = sys.executable
+ if sys.platform == "win32":
+ executable = f'"{executable}"'
+ cmd = f'''{executable} -c "import os, sys; sys.stdout.write(os.getenv('FOO'))"'''
env = os.environ.copy()
env["FOO"] = "bar"
proc = await asyncio.create_subprocess_shell(