11# Platform-specific subprocess bits'n'pieces.
2+ from __future__ import annotations
23
34import os
45import sys
5- from typing import TYPE_CHECKING , Optional , Tuple
6+ from typing import TYPE_CHECKING
67
78import trio
89
910from .. import _core , _subprocess
1011from .._abc import ReceiveStream , SendStream # noqa: TCH001
1112
12- _wait_child_exiting_error : Optional [ ImportError ] = None
13- _create_child_pipe_error : Optional [ ImportError ] = None
13+ _wait_child_exiting_error : ImportError | None = None
14+ _create_child_pipe_error : ImportError | None = None
1415
1516
1617if TYPE_CHECKING :
@@ -26,7 +27,7 @@ def close(self) -> None:
2627
2728# Fallback versions of the functions provided -- implementations
2829# per OS are imported atop these at the bottom of the module.
29- async def wait_child_exiting (process : " _subprocess.Process" ) -> None :
30+ async def wait_child_exiting (process : _subprocess .Process ) -> None :
3031 """Block until the child process managed by ``process`` is exiting.
3132
3233 It is invalid to call this function if the process has already
@@ -41,7 +42,7 @@ async def wait_child_exiting(process: "_subprocess.Process") -> None:
4142 raise NotImplementedError from _wait_child_exiting_error # pragma: no cover
4243
4344
44- def create_pipe_to_child_stdin () -> Tuple [ " ClosableSendStream" , int ]:
45+ def create_pipe_to_child_stdin () -> tuple [ ClosableSendStream , int ]:
4546 """Create a new pipe suitable for sending data from this
4647 process to the standard input of a child we're about to spawn.
4748
@@ -54,7 +55,7 @@ def create_pipe_to_child_stdin() -> Tuple["ClosableSendStream", int]:
5455 raise NotImplementedError from _create_child_pipe_error # pragma: no cover
5556
5657
57- def create_pipe_from_child_output () -> Tuple [ " ClosableReceiveStream" , int ]:
58+ def create_pipe_from_child_output () -> tuple [ ClosableReceiveStream , int ]:
5859 """Create a new pipe suitable for receiving data into this
5960 process from the standard output or error stream of a child
6061 we're about to spawn.
0 commit comments