summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-03-19 13:42:44 (GMT)
committerGitHub <noreply@github.com>2024-03-19 13:42:44 (GMT)
commit27cf3ed00cfe942f4277c273a3dda8ee2ba61fc8 (patch)
tree18d2811b50c3e556e680c3fd91db7f39b8a57b2a /Lib/subprocess.py
parent408e127159e54d87bb3464fd8bd60219dc527fac (diff)
downloadcpython-27cf3ed00cfe942f4277c273a3dda8ee2ba61fc8.zip
cpython-27cf3ed00cfe942f4277c273a3dda8ee2ba61fc8.tar.gz
cpython-27cf3ed00cfe942f4277c273a3dda8ee2ba61fc8.tar.bz2
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.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 1437bf8..dbe1527 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -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: