@@ -62,12 +62,8 @@ def __init__(self, popen_obj: subprocess.Popen[bytes]):
62
62
self .stdout_raw = popen_obj .stdout # type: ignore[assignment]
63
63
self .stderr = popen_obj .stderr # type: ignore[assignment]
64
64
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
71
67
72
68
async def __aenter__ (self ):
73
69
"""Support async context manager entry."""
@@ -91,6 +87,10 @@ def terminate(self):
91
87
"""Terminate the subprocess immediately."""
92
88
return self .popen .terminate ()
93
89
90
+ def kill (self ) -> None :
91
+ """Kill the subprocess immediately (alias for terminate)."""
92
+ self .terminate ()
93
+
94
94
95
95
# ------------------------
96
96
# Updated function
@@ -131,7 +131,7 @@ async def create_windows_process(
131
131
env = env ,
132
132
cwd = cwd ,
133
133
bufsize = 0 , # Unbuffered output
134
- creationflags = getattr (subprocess , "CREATE_NO_WINDOW" , 0 ),
134
+ creationflags = getattr (subprocess , "CREATE_NO_WINDOW" , 0 ),
135
135
)
136
136
return DummyProcess (popen_obj )
137
137
@@ -148,7 +148,8 @@ async def create_windows_process(
148
148
)
149
149
return DummyProcess (popen_obj )
150
150
151
- async def terminate_windows_process (process : Process ):
151
+
152
+ async def terminate_windows_process (process : Process | DummyProcess ):
152
153
"""
153
154
Terminate a Windows process.
154
155
0 commit comments