gh-109888: Fix test_os _kill_with_event() on Windows (#110421)
Replace os.kill() with proc.kill() which catchs PermissionError.
Rewrite _kill_with_event():
* Use subprocess context manager ("with proc:").
* Use sleeping_retry() to wait until the child process is ready.
* Replace SIGINT with proc.kill() on error.
* Replace 10 seconds with SHORT_TIMEOUT to wait until the process is
ready.
* Replace 0.5 seconds with SHORT_TIMEOUT to wait for the process
exit. V
Victor Stinner committed
aaf297c048694cd9652790f8b74e69f7ddadfbde
Parent: fb6c4ed
Committed by GitHub <noreply@github.com>
on 10/5/2023, 9:40:49 PM