Commit f33ed4d
fix: avoid os.kill on Windows due to CPython C exception state corruption
os.kill(pid, 0) on Windows corrupts CPython C-level exception state
even after the raised OSError is caught. This causes subsequent calls to
C built-ins (time.monotonic, time.sleep) to raise SystemError. Use
ctypes OpenProcess instead, which is the proper Win32 API for checking
process existence.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d4fcdb0 commit f33ed4d
1 file changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
223 | 236 | | |
224 | 237 | | |
225 | 238 | | |
226 | 239 | | |
227 | 240 | | |
228 | 241 | | |
229 | 242 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | 243 | | |
236 | 244 | | |
237 | 245 | | |
| |||
0 commit comments