--- a/eric6/UI/UserInterface.py Wed Apr 21 19:40:50 2021 +0200 +++ b/eric6/UI/UserInterface.py Thu Apr 22 18:02:47 2021 +0200 @@ -4121,15 +4121,16 @@ @param ask flag indicating to ask the user for permission @type bool """ - if ask: - res = E5MessageBox.yesNo( + res = ( + E5MessageBox.yesNo( self, self.tr("Restart application"), self.tr( """The application needs to be restarted. Do it now?"""), yesDefault=True) - else: - res = True + if ask else + True + ) if res and self.__shutdown(): e5App().closeAllWindows() @@ -6304,14 +6305,15 @@ if ex: fn += ex - if os.path.exists(fn): - ok = E5MessageBox.yesNo( + ok = ( + E5MessageBox.yesNo( self, self.tr("Export Keyboard Shortcuts"), self.tr("""<p>The keyboard shortcuts file <b>{0}</b> exists""" """ already. Overwrite it?</p>""").format(fn)) - else: - ok = True + if os.path.exists(fn) else + True + ) if ok: from Preferences import Shortcuts