summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-03-08 14:23:56 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2012-03-17 19:34:19 +0000
commit191b21a3b932767099600ef708eb7e921cb61e0a (patch)
treebff46139503bf62364a57b53323431588baf7cb8
parentcf8517cd4a908a7dccbe7e06a2d8496b687231ca (diff)
ignore exceptions when stopping reactor
.. in ui.exit issue #264
-rw-r--r--alot/ui.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/alot/ui.py b/alot/ui.py
index 5a0c484e..3c43f3a4 100644
--- a/alot/ui.py
+++ b/alot/ui.py
@@ -1,6 +1,7 @@
import urwid
import logging
from twisted.internet import reactor, defer
+import sys
from settings import settings
from buffers import BufferlistBuffer
@@ -182,7 +183,12 @@ class UI(object):
shuts down user interface without cleaning up.
Use a :class:`commands.globals.ExitCommand` for a clean shutdown.
"""
- reactor.stop()
+ exit_msg = None
+ try:
+ reactor.stop()
+ except Exception as e:
+ exit_msg = 'Could not stop reactor: {}.'.format(e)
+ logging.error(exit_msg + '\nShutting down anyway..')
def buffer_open(self, buf):
"""register and focus new :class:`~alot.buffers.Buffer`."""