changeset 1884:0fe69871b71f

jp: moved KeyboardInterrupt catch one level higher, so it is also catched if the loop is not started
author Goffi <goffi@goffi.org>
date Sat, 05 Mar 2016 18:00:56 +0100 (2016-03-05)
parents abb2f253188e
children edd8dc8df1b9
files frontends/src/jp/base.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/jp/base.py	Sat Mar 05 18:00:12 2016 +0100
+++ b/frontends/src/jp/base.py	Sat Mar 05 18:00:56 2016 +0100
@@ -249,16 +249,16 @@
 
     def run(self, args=None):
         self.args = self.parser.parse_args(args)
-        self.args.func()
-        if self._need_loop or self._auto_loop:
-            self._start_loop()
+        try:
+            self.args.func()
+            if self._need_loop or self._auto_loop:
+                self._start_loop()
+        except KeyboardInterrupt:
+            log.info(_("User interruption: good bye"))
 
     def _start_loop(self):
         self.loop = GLib.MainLoop()
-        try:
-            self.loop.run()
-        except KeyboardInterrupt:
-            log.info(_("User interruption: good bye"))
+        self.loop.run()
 
     def stop_loop(self):
         try: