From 89bf69f497c5eda4fac45656ad8d9a19c34e987f Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Fri, 14 Oct 2016 19:12:56 -0400 Subject: [PATCH] Make ^C tracebacks a bit prettier --- uvloop/loop.pyx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/uvloop/loop.pyx b/uvloop/loop.pyx index 3c366a9..3ad02dd 100644 --- a/uvloop/loop.pyx +++ b/uvloop/loop.pyx @@ -219,12 +219,16 @@ cdef class Loop: try: 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: