From 56495f81fc7205b572173a03d418e0f9291f9eea Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Sun, 16 Feb 2025 13:52:04 +0000 Subject: [PATCH] gh-130080: return in finally in subprocess.py (#130081) --- Lib/subprocess.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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: -- 2.47.3