Internal helper that is the actual signal handler.
(self, sig)
| 133 | raise |
| 134 | |
| 135 | def _handle_signal(self, sig): |
| 136 | """Internal helper that is the actual signal handler.""" |
| 137 | handle = self._signal_handlers.get(sig) |
| 138 | if handle is None: |
| 139 | return # Assume it's some race condition. |
| 140 | if handle._cancelled: |
| 141 | self.remove_signal_handler(sig) # Remove it properly. |
| 142 | else: |
| 143 | self._add_callback_signalsafe(handle) |
| 144 | |
| 145 | def remove_signal_handler(self, sig): |
| 146 | """Remove a handler for a signal. UNIX only. |