File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 88from abc import abstractmethod
99from contextlib import contextmanager
1010from pathlib import Path
11- from typing import IO , TYPE_CHECKING , Any
12-
13- from rich .progress import Progress
14-
15- from ._util import SingletonContextManager
11+ from typing import TYPE_CHECKING , Any
1612
1713if sys .version_info >= (3 , 9 ):
1814 from collections .abc import (
3329 Sequence ,
3430 )
3531
32+ if TYPE_CHECKING :
33+ from io import TextIOBase
34+
35+ from rich .progress import Progress
36+
37+ from ._util import SingletonContextManager
38+
3639if sys .version_info >= (3 , 11 ):
3740 from typing import Self
3841else :
@@ -278,7 +281,7 @@ def __cmd_name(cmd: Sequence[str | os.PathLike[str]] | str) -> str:
278281 @contextmanager
279282 def __output (
280283 self , cmd : Sequence [str | os .PathLike [str ]] | str , * , log : bool
281- ) -> Generator [tuple [int | IO [ str ] , int | IO [ str ] ], None , None ]:
284+ ) -> Generator [tuple [int | TextIOBase , int | TextIOBase ], None , None ]:
282285 if log :
283286 with (self .path / f"log.{ self .__cmd_name (cmd )} " ).open ("a" ) as stdout :
284287 yield stdout , STDOUT
Original file line number Diff line number Diff line change 77import subprocess
88import sys
99import time
10- from io import StringIO
10+ from io import StringIO , TextIOBase
1111from pathlib import Path
1212
1313if sys .version_info >= (3 , 9 ):
@@ -68,8 +68,8 @@ def run_sync(
6868 * ,
6969 case : Path ,
7070 check : bool = True ,
71- stdout : int | StringIO = DEVNULL ,
72- stderr : int | StringIO = STDOUT ,
71+ stdout : int | TextIOBase = DEVNULL ,
72+ stderr : int | TextIOBase = STDOUT ,
7373 process_stdout : Callable [[str ], None ] = lambda _ : None ,
7474) -> CompletedProcess [str ]:
7575 # Set up log file monitoring
@@ -146,8 +146,8 @@ async def run_async(
146146 * ,
147147 case : Path ,
148148 check : bool = True ,
149- stdout : int | StringIO = DEVNULL ,
150- stderr : int | StringIO = STDOUT ,
149+ stdout : int | TextIOBase = DEVNULL ,
150+ stderr : int | TextIOBase = STDOUT ,
151151 process_stdout : Callable [[str ], None ] = lambda _ : None ,
152152) -> CompletedProcess [str ]:
153153 # Set up log file monitoring
You can’t perform that action at this time.
0 commit comments