Merge branch '2018.3' into network_dns_check_test

This commit is contained in:
Pedro Algarvio 2019-01-25 09:28:00 +00:00 committed by GitHub
commit 055eadc1c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -806,7 +806,7 @@ def default_signals(*signals):
old_signals = {}
for signum in signals:
try:
old_signals[signum] = signal.getsignal(signum)
saved_signal = signal.getsignal(signum)
signal.signal(signum, signal.SIG_DFL)
except ValueError as exc:
# This happens when a netapi module attempts to run a function
@ -816,6 +816,8 @@ def default_signals(*signals):
'Failed to register signal for signum %d: %s',
signum, exc
)
else:
old_signals[signum] = saved_signal
# Do whatever is needed with the reset signals
yield