gh-90872: Fix subprocess.Popen.wait() for negative timeout (#116989)
On Windows, subprocess.Popen.wait() no longer calls WaitForSingleObject() with a negative timeout: pass 0 ms if the timeout is negative.
This commit is contained in:
@@ -1586,6 +1586,8 @@ class Popen:
|
||||
"""Internal implementation of wait() on Windows."""
|
||||
if timeout is None:
|
||||
timeout_millis = _winapi.INFINITE
|
||||
elif timeout <= 0:
|
||||
timeout_millis = 0
|
||||
else:
|
||||
timeout_millis = int(timeout * 1000)
|
||||
if self.returncode is None:
|
||||
|
||||
Reference in New Issue
Block a user