+ # The error is not an interrupt caused by the alarm, then raise
+ if e.args[0] != errno.EINTR or not timeout:
+ raise LoopInterruptedError(e)
+ # There was a timeout, so execute the timer handler
+ if timeout:
+ timeout = False
+ self.handle_timer()
+ signal.alarm(self.timer)
+ # Not a timeout, execute the regular handler