From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Sun, 16 Feb 2025 13:52:04 +0000 (+0000) Subject: gh-130080: return in finally in subprocess.py (#130081) X-Git-Tag: v3.14.0a6~401 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56495f81fc7205b572173a03d418e0f9291f9eea;p=thirdparty%2FPython%2Fcpython.git gh-130080: return in finally in subprocess.py (#130081) --- diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 2044d2a42897..1948ac8a3a1d 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1123,10 +1123,9 @@ class Popen: except TimeoutExpired: pass self._sigint_wait_secs = 0 # Note that this has been done. - return # resume the KeyboardInterrupt - - # Wait for the process to terminate, to avoid zombies. - self.wait() + else: + # Wait for the process to terminate, to avoid zombies. + self.wait() def __del__(self, _maxsize=sys.maxsize, _warn=warnings.warn): if not self._child_created: