mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 13:32:26 +08:00
Allow Path in create_subprocess_* (#4159)
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import sys
|
||||
from asyncio import events
|
||||
from asyncio import protocols
|
||||
from asyncio import streams
|
||||
from asyncio import transports
|
||||
from typing import Any, Optional, Text, Tuple, Union, IO
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from os import PathLike
|
||||
_ExecArg = Union[str, bytes, PathLike[str], PathLike[bytes]]
|
||||
else:
|
||||
_ExecArg = Union[str, bytes] # Union used instead of AnyStr due to mypy issue #1236
|
||||
|
||||
PIPE: int
|
||||
STDOUT: int
|
||||
DEVNULL: int
|
||||
@@ -49,8 +56,8 @@ async def create_subprocess_shell(
|
||||
) -> Process: ...
|
||||
|
||||
async def create_subprocess_exec(
|
||||
program: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236
|
||||
*args: Any,
|
||||
program: _ExecArg,
|
||||
*args: _ExecArg,
|
||||
stdin: Union[int, IO[Any], None] = ...,
|
||||
stdout: Union[int, IO[Any], None] = ...,
|
||||
stderr: Union[int, IO[Any], None] = ...,
|
||||
|
||||
Reference in New Issue
Block a user