mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Revert "gh-127586: properly restore blocked signals in resource_tracker.py (GH-127587)" (#127983)
This reverts commit 46006a1b35
.
This commit is contained in:
parent
e4981e33b8
commit
1d276ec6f8
3 changed files with 3 additions and 22 deletions
|
@ -155,14 +155,13 @@ class ResourceTracker(object):
|
|||
# that can make the child die before it registers signal handlers
|
||||
# for SIGINT and SIGTERM. The mask is unregistered after spawning
|
||||
# the child.
|
||||
prev_sigmask = None
|
||||
try:
|
||||
if _HAVE_SIGMASK:
|
||||
prev_sigmask = signal.pthread_sigmask(signal.SIG_BLOCK, _IGNORED_SIGNALS)
|
||||
signal.pthread_sigmask(signal.SIG_BLOCK, _IGNORED_SIGNALS)
|
||||
pid = util.spawnv_passfds(exe, args, fds_to_pass)
|
||||
finally:
|
||||
if prev_sigmask is not None:
|
||||
signal.pthread_sigmask(signal.SIG_SETMASK, prev_sigmask)
|
||||
if _HAVE_SIGMASK:
|
||||
signal.pthread_sigmask(signal.SIG_UNBLOCK, _IGNORED_SIGNALS)
|
||||
except:
|
||||
os.close(w)
|
||||
raise
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue