Skip to content

Commit 56495f8

Browse files
authored
gh-130080: return in finally in subprocess.py (#130081)
1 parent 73d0300 commit 56495f8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Lib/subprocess.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,10 +1123,9 @@ def __exit__(self, exc_type, value, traceback):
11231123
except TimeoutExpired:
11241124
pass
11251125
self._sigint_wait_secs = 0 # Note that this has been done.
1126-
return # resume the KeyboardInterrupt
1127-
1128-
# Wait for the process to terminate, to avoid zombies.
1129-
self.wait()
1126+
else:
1127+
# Wait for the process to terminate, to avoid zombies.
1128+
self.wait()
11301129

11311130
def __del__(self, _maxsize=sys.maxsize, _warn=warnings.warn):
11321131
if not self._child_created:

0 commit comments

Comments
 (0)