Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Bénédikt Tran <[email protected]>
  • Loading branch information
csm10495 and picnixz authored Dec 18, 2024
1 parent f7ad96c commit 2c0b578
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Lib/concurrent/futures/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,14 +875,14 @@ def terminate_workers(self, signal=signal.SIGTERM):

for pid, proc in self._processes.items():
try:
is_alive = proc.is_alive()
if not proc.is_alive():
continue
except ValueError:
# The process is already exited/closed out.
is_alive = False
continue

if is_alive:
try:
os.kill(pid, signal)
except ProcessLookupError:
# The process just ended before our signal
pass
try:
os.kill(pid, signal)
except ProcessLookupError:
# The process just ended before our signal
pass

0 comments on commit 2c0b578

Please sign in to comment.