--- a/eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py Wed Apr 21 17:56:12 2021 +0200 +++ b/eric6/Preferences/ConfigurationPages/EditorHighlightingStylesPage.py Wed Apr 21 19:40:50 2021 +0200 @@ -354,10 +354,11 @@ self.sampleText.setFont(font) style, substyle = self.__currentStyles() - if self.monospacedButton.isChecked(): - options = MonospacedFontsOption - else: - options = NoFontsOption + options = ( + MonospacedFontsOption + if self.monospacedButton.isChecked() else + NoFontsOption + ) font, ok = QFontDialog.getFont(self.lexer.font(style, substyle), self, "", options) if ok: @@ -565,14 +566,15 @@ if ex: fn += ex - if os.path.exists(fn): - ok = E5MessageBox.yesNo( + ok = ( + E5MessageBox.yesNo( self, self.tr("Export Highlighting Styles"), self.tr("""<p>The highlighting styles file <b>{0}</b> exists""" """ already. Overwrite it?</p>""").format(fn)) - else: - ok = True + if os.path.exists(fn) else + True + ) if ok: if fn.endswith(".ehj"):