Merge pull request #51321 from terminalmage/issue51256

Fix 500 error when using wheel_async
This commit is contained in:
Daniel Wozniak 2019-01-24 20:51:34 -07:00 committed by GitHub
commit be57a0f55c
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