Skip to content

Commit 5b66868

Browse files
Allow Path in create_subprocess_* (#4159)
1 parent eea9be6 commit 5b66868

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

stdlib/3/asyncio/subprocess.pyi

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
import sys
12
from asyncio import events
23
from asyncio import protocols
34
from asyncio import streams
45
from asyncio import transports
56
from typing import Any, Optional, Text, Tuple, Union, IO
67

8+
if sys.version_info >= (3, 8):
9+
from os import PathLike
10+
_ExecArg = Union[str, bytes, PathLike[str], PathLike[bytes]]
11+
else:
12+
_ExecArg = Union[str, bytes] # Union used instead of AnyStr due to mypy issue #1236
13+
714
PIPE: int
815
STDOUT: int
916
DEVNULL: int
@@ -49,8 +56,8 @@ async def create_subprocess_shell(
4956
) -> Process: ...
5057

5158
async def create_subprocess_exec(
52-
program: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236
53-
*args: Any,
59+
program: _ExecArg,
60+
*args: _ExecArg,
5461
stdin: Union[int, IO[Any], None] = ...,
5562
stdout: Union[int, IO[Any], None] = ...,
5663
stderr: Union[int, IO[Any], None] = ...,

0 commit comments

Comments
 (0)