https://github.com/python/cpython/commit/56495f81fc7205b572173a03d418e0f9291f9eea
commit: 56495f81fc7205b572173a03d418e0f9291f9eea
branch: main
author: Irit Katriel <[email protected]>
committer: iritkatriel <[email protected]>
date: 2025-02-16T13:52:04Z
summary:

gh-130080: return in finally in subprocess.py (#130081)

files:
M Lib/subprocess.py

diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 2044d2a42897e9..1948ac8a3a1dfe 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1123,10 +1123,9 @@ def __exit__(self, exc_type, value, traceback):
                     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:

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to