mirror of
https://github.com/python/cpython.git
synced 2025-11-01 22:21:35 +00:00
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:
parent
408e127159
commit
27cf3ed00c
3 changed files with 21 additions and 0 deletions
|
|
@ -1586,6 +1586,8 @@ def _wait(self, timeout):
|
|||
"""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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue