Do not suppress KeyboardInterrupt exceptions
The encompassing application should be responsible for handling the KeyboardInterrupt exception
This commit is contained in:
parent
2e2496cd4c
commit
13ffc8cf7f
1 changed files with 16 additions and 19 deletions
|
|
@ -167,26 +167,23 @@ class SocketIO(object):
|
||||||
|
|
||||||
- Omit seconds, i.e. call wait() without arguments, to wait forever.
|
- Omit seconds, i.e. call wait() without arguments, to wait forever.
|
||||||
"""
|
"""
|
||||||
try:
|
warning_screen = _yield_warning_screen(seconds)
|
||||||
warning_screen = _yield_warning_screen(seconds)
|
for elapsed_time in warning_screen:
|
||||||
for elapsed_time in warning_screen:
|
try:
|
||||||
try:
|
try:
|
||||||
try:
|
self._process_events()
|
||||||
self._process_events()
|
except TimeoutError:
|
||||||
except TimeoutError:
|
pass
|
||||||
pass
|
if self._stop_waiting(for_callbacks):
|
||||||
if self._stop_waiting(for_callbacks):
|
break
|
||||||
break
|
self.heartbeat_pacemaker.send(elapsed_time)
|
||||||
self.heartbeat_pacemaker.send(elapsed_time)
|
except ConnectionError as e:
|
||||||
except ConnectionError as e:
|
try:
|
||||||
try:
|
warning = Exception('[connection error] %s' % e)
|
||||||
warning = Exception('[connection error] %s' % e)
|
warning_screen.throw(warning)
|
||||||
warning_screen.throw(warning)
|
except StopIteration:
|
||||||
except StopIteration:
|
_log.warn(warning)
|
||||||
_log.warn(warning)
|
self.disconnect()
|
||||||
self.disconnect()
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def _process_events(self):
|
def _process_events(self):
|
||||||
for packet in self._transport.recv_packet():
|
for packet in self._transport.recv_packet():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue