mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Do not use the pygments based highlighter if the user does not have pygments (will happen on some linux distros and for people running from source who dont update the binary)
This commit is contained in:
parent
cabc1280f8
commit
66bfe1797b
@ -40,8 +40,11 @@ def get_highlighter(syntax):
|
|||||||
if ans is SyntaxHighlighter:
|
if ans is SyntaxHighlighter:
|
||||||
# Load these highlighters only on demand
|
# Load these highlighters only on demand
|
||||||
if syntax == 'python':
|
if syntax == 'python':
|
||||||
from calibre.gui2.tweak_book.editor.syntax.python import PythonHighlighter
|
try:
|
||||||
ans = PythonHighlighter
|
from calibre.gui2.tweak_book.editor.syntax.python import PythonHighlighter
|
||||||
|
ans = PythonHighlighter
|
||||||
|
except ImportError:
|
||||||
|
pass # For people running from source
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
_dff = None
|
_dff = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user