jp: moved KeyboardInterrupt catch one level higher, so it is also catched if the loop is not started

This commit is contained in:
Goffi 2016-03-05 18:00:56 +01:00
commit 4b941591c5

View file

@ -249,16 +249,16 @@ class Jp(object):
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: