8000 bpo-40550: Fix time-of-check/time-of-action issue in subprocess.Popen.send_signal. by FFY00 · Pull Request #20010 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-40550: Fix time-of-check/time-of-action issue in subprocess.Popen.send_signal. #20010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 21, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove a redundant check of errno.
The ProcessLookupError already means errno == ESRCH.
  • Loading branch information
gpshead authored Nov 21, 2020
commit 1605031b9a5eeb922feb7d76ebfad583a9637a96
8 changes: 3 additions & 5 deletions Lib/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -2063,11 +2063,9 @@ def send_signal(self, sig):
# and the kill() call.
try:
os.kill(self.pid, sig)
except ProcessLookupError as e:
# supress the process not found error in case the race
# condition happens, see bpo-40550
if e.errno != errno.ESRCH:
raise e
except ProcessLookupError:
# Supress the race condition error; bpo-40550.
pass

def terminate(self):
"""Terminate the process with SIGTERM
Expand Down
0