Make ^C tracebacks a bit prettier

This commit is contained in:
Yury Selivanov 2016-10-14 19:12:56 -04:00
parent fb62f85747
commit 89bf69f497
1 changed files with 4 additions and 0 deletions

View File

@ -219,12 +219,16 @@ cdef class Loop:
try:
handle = <Handle>(self._signal_handlers[sig])
except KeyError:
handle = None
if handle is None:
# Some signal that we aren't listening through
# add_signal_handler. Invoke CPython eval loop
# to let it being processed.
PyErr_CheckSignals()
_noop.noop()
return
if handle.cancelled:
self.remove_signal_handler(sig) # Remove it properly.
else: