diff options
author | 依云 <lilydjwg@gmail.com> | 2019-05-29 06:50:59 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-05-29 06:50:59 (GMT) |
commit | 744c08a9c75a1a53b7a6521fcee3e7c513919ff9 (patch) | |
tree | 432a13057b4f1031536f30a06ca6618f85d102b4 /Lib/test | |
parent | e1f95e77e0647aff602e0660ba3c282b71045875 (diff) | |
download | cpython-744c08a9c75a1a53b7a6521fcee3e7c513919ff9.zip cpython-744c08a9c75a1a53b7a6521fcee3e7c513919ff9.tar.gz cpython-744c08a9c75a1a53b7a6521fcee3e7c513919ff9.tar.bz2 |
bpo-35246: fix support for path-like args in asyncio subprocess (GH-13628)
Drop isinstance checks from create_subprocess_exec function and let
subprocess module do them.
https://bugs.python.org/issue35246
https://bugs.python.org/issue35246
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_asyncio/test_subprocess.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index f1ab039..7d72e6c 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -622,6 +622,17 @@ class SubprocessMixin: self.loop.run_until_complete(execute()) + def test_create_subprocess_exec_with_path(self): + async def execute(): + p = await subprocess.create_subprocess_exec( + support.FakePath(sys.executable), '-c', 'pass') + await p.wait() + p = await subprocess.create_subprocess_exec( + sys.executable, '-c', 'pass', support.FakePath('.')) + await p.wait() + + self.assertIsNone(self.loop.run_until_complete(execute())) + if sys.platform != 'win32': # Unix class SubprocessWatcherMixin(SubprocessMixin): |