Skip to content

Commit

Permalink
Quit mainloop when receiving a KeyboardInterrupt exception.
Browse files Browse the repository at this point in the history
refs #48
  • Loading branch information
tmbinc committed Nov 10, 2008
1 parent a6419d3 commit 50cfe22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion e2reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ def unregister(self, fd):
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()
Expand Down

0 comments on commit 50cfe22

Please sign in to comment.