def run(self): """ Start the event loop. Exit the loop when any callback raises an exception. If ExitMainLoop is raised, exit cleanly. """ self._loop.set_exception_handler(self._exception_handler) self._loop.run_forever() if self._exc_info: exc_info = self._exc_info self._exc_info = None reraise(*exc_info)
def run(self): """ Start the event loop. Exit the loop when any callback raises an exception. If ExitMainLoop is raised, exit cleanly. """ if not self.manage_reactor: return self.reactor.run() if self._exc_info: # An exception caused us to exit, raise it now exc_info = self._exc_info self._exc_info = None reraise(*exc_info)
def run(self): """ Start the event loop. Exit the loop when any callback raises an exception. If ExitMainLoop is raised, exit cleanly. """ try: self._loop.run() finally: if self._loop.is_running(): self._loop.quit() if self._exc_info: # An exception caused us to exit, raise it now exc_info = self._exc_info self._exc_info = None reraise(*exc_info)