summaryrefslogtreecommitdiff
path: root/urwid
diff options
context:
space:
mode:
authorRuurd Moelker <None@rtop.com>2014-12-05 15:04:59 +0100
committerRuurd Moelker <None@rtop.com>2014-12-05 15:04:59 +0100
commit2a81ec15e73bfb6830b65cc1695621ecdb296462 (patch)
tree6a805e27c5e7a48ead6325462accb6a3571e907e /urwid
parentb851b905cb8c6c46a1757d0ccca2adbd02740ba7 (diff)
downloadurwid-2a81ec15e73bfb6830b65cc1695621ecdb296462.tar.gz
cleanup screen claim on runtime exception
Diffstat (limited to 'urwid')
-rwxr-xr-xurwid/main_loop.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/urwid/main_loop.py b/urwid/main_loop.py
index 77022bf..6ada032 100755
--- a/urwid/main_loop.py
+++ b/urwid/main_loop.py
@@ -372,7 +372,11 @@ class MainLoop(object):
finally:
self.screen.stop()
- self.event_loop.run()
+ try:
+ self.event_loop.run()
+ except Exception as e:
+ self.screen.stop() # clean up screen control
+ raise e
self.stop()
def _update(self, keys, raw):