diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index 13cd92be1b..1653ac26d6 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -32,10 +32,10 @@ PARAGRAPH_SEPARATOR = '\u2029' def get_highlighter(syntax): try: - ans = importlib.import_module('calibre.gui2.tweak_book.editor.syntax.' + syntax).Highlighter + return importlib.import_module('calibre.gui2.tweak_book.editor.syntax.' + syntax).Highlighter except (ImportError, AttributeError): - ans = SyntaxHighlighter - return ans + pass + return SyntaxHighlighter def get_smarts(syntax): smartsname = {'xml':'html'}.get(syntax, syntax)