Dont try to show a dialog when calling shutdown_other with a QApplication

This commit is contained in:
Kovid Goyal 2020-12-18 18:23:49 +05:30
parent d8e7a58646
commit f408f8a466
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -437,9 +437,10 @@ def send_message(msg):
except Exception as err:
print(_('Failed to contact running instance of calibre'), file=sys.stderr, flush=True)
print(err, file=sys.stderr, flush=True)
error_dialog(None, _('Contacting calibre failed'), _(
'Failed to contact running instance of calibre, try restarting calibre'),
det_msg=str(err) + '\n\n' + repr(msg), show=True)
if Application.instance():
error_dialog(None, _('Contacting calibre failed'), _(
'Failed to contact running instance of calibre, try restarting calibre'),
det_msg=str(err) + '\n\n' + repr(msg), show=True)
return False
return True