From: Felix Domke Date: Mon, 10 Nov 2008 14:03:56 +0000 (+0100) Subject: Quit mainloop when receiving a KeyboardInterrupt exception. X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=50cfe22239cc16d5b8d9db3a69e5ffb3b1507b8d Quit mainloop when receiving a KeyboardInterrupt exception. refs #48 --- diff --git a/e2reactor.py b/e2reactor.py index a3d8ce1..cca2f35 100644 --- a/e2reactor.py +++ b/e2reactor.py @@ -36,7 +36,10 @@ class E2SharedPoll: del self.dict[fd] def poll(self, timeout = None): - r = self.eApp.poll(timeout, self.dict) + try: + r = self.eApp.poll(timeout, self.dict) + except KeyboardInterrupt: + return None return r poller = E2SharedPoll()