10000 Add asyncio.windows_utils.Popen (#7396) · python/typeshed@0a6b6b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0a6b6b0

Browse files
Add asyncio.windows_utils.Popen (#7396)
1 parent 5802e88 commit 0a6b6b0

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

stdlib/asyncio/windows_utils.pyi

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import subprocess
22
import sys
33
from _typeshed import Self
44
from types import TracebackType
5-
from typing import Callable, Protocol
5+
from typing import Any, AnyStr, Callable, Protocol
66
from typing_extensions import Literal
77

88
if sys.platform == "win32":
@@ -36,3 +36,28 @@ if sys.platform == "win32":
3636
def handle(self) -> int: ...
3737
def fileno(self) -> int: ...
3838
def close(self, *, CloseHandle: Callable[[int], None] = ...) -> None: ...
39+
40+
class Popen(subprocess.Popen[AnyStr]):
41+
stdin: PipeHandle | None # type: ignore[assignment]
42+
stdout: PipeHandle | None # type: ignore[assignment]
43+
stderr: PipeHandle | None # type: ignore[assignment]
44+
# For simplicity we omit the full overloaded __new__ signature of
45+
# subprocess.Popen. The arguments are mostly the same, but
46+
# subprocess.Popen takes other positional-or-keyword arguments before
47+
# stdin.
48+
def __new__(
49+
cls: type[Self],
50+
args: subprocess._CMD,
51+
stdin: subprocess._FILE | None = ...,
52+
stdout: subprocess._FILE | None = ...,
53+
stderr: subprocess._FILE | None = ...,
54+
**kwds: Any,
55+
) -> Self: ...
56+
def __init__(
57+
self,
58+
args: subprocess._CMD,
59+
stdin: subprocess._FILE | None = ...,
60+
stdout: subprocess._FILE | None = ...,
61+
stderr: subprocess._FILE | None = ...,
62+
**kwds: Any,
63+
) -> None: ...

tests/stubtest_allowlists/win32.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ pathlib.Path.group
6565

6666
# Exists at runtime, but missing from stubs
6767
_msi.MSIError
68-
asyncio.windows_utils.Popen
6968
distutils.msvccompiler.MSVCCompiler.manifest_get_embed_info
7069
distutils.msvccompiler.MSVCCompiler.manifest_setup_ldargs
7170
distutils.msvccompiler.OldMSVCCompiler

0 commit comments

Comments
 (0)
0