From 3f55f146015170181e0e41b69ded0cb1ed69d5e0 Mon Sep 17 00:00:00 2001 From: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Date: Sat, 10 Dec 2022 14:34:29 +0530 Subject: [PATCH] use sys.executable --- Lib/test/test_asyncio/test_subprocess.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index 90a0965f732979..31cdaac24c6c5a 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -697,7 +697,8 @@ async def get_command_stdout(cmd, *args): async def main(): outputs = [f'foo{i}' for i in range(10)] - res = await asyncio.gather(*[get_command_stdout('echo', out) for out in outputs]) + res = await asyncio.gather(*[get_command_stdout(sys.executable, '-c', + f'import sys; print({out!r})') for out in outputs]) self.assertEqual(res, outputs) self.loop.run_until_complete(main())