jp: moved KeyboardInterrupt catch one level higher, so it is also catched if the loop is not started
This commit is contained in:
parent
49f2646315
commit
4b941591c5
1 changed files with 7 additions and 7 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue