@@ -62,12 +62,8 @@ def __init__(self, popen_obj: subprocess.Popen[bytes]):
6262 self .stdout_raw = popen_obj .stdout # type: ignore[assignment]
6363 self .stderr = popen_obj .stderr # type: ignore[assignment]
6464
65- self .stdin = (
66- FileWriteStream (cast (BinaryIO , self .stdin_raw )) if self .stdin_raw else None
67- )
68- self .stdout = (
69- FileReadStream (cast (BinaryIO , self .stdout_raw )) if self .stdout_raw else None
70- )
65+ self .stdin = FileWriteStream (cast (BinaryIO , self .stdin_raw )) if self .stdin_raw else None
66+ self .stdout = FileReadStream (cast (BinaryIO , self .stdout_raw )) if self .stdout_raw else None
7167
7268 async def __aenter__ (self ):
7369 """Support async context manager entry."""
@@ -91,6 +87,10 @@ def terminate(self):
9187 """Terminate the subprocess immediately."""
9288 return self .popen .terminate ()
9389
90+ def kill (self ) -> None :
91+ """Kill the subprocess immediately (alias for terminate)."""
92+ self .terminate ()
93+
9494
9595# ------------------------
9696# Updated function
@@ -131,7 +131,7 @@ async def create_windows_process(
131131 env = env ,
132132 cwd = cwd ,
133133 bufsize = 0 , # Unbuffered output
134- creationflags = getattr (subprocess , "CREATE_NO_WINDOW" , 0 ),
134+ creationflags = getattr (subprocess , "CREATE_NO_WINDOW" , 0 ),
135135 )
136136 return DummyProcess (popen_obj )
137137
@@ -148,7 +148,8 @@ async def create_windows_process(
148148 )
149149 return DummyProcess (popen_obj )
150150
151- async def terminate_windows_process (process : Process ):
151+
152+ async def terminate_windows_process (process : Process | DummyProcess ):
152153 """
153154 Terminate a Windows process.
154155
0 commit comments