Skip to content

Allow Path in create_subprocess_* #4159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions stdlib/3/asyncio/subprocess.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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] = ...,
Expand Down