mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-22 21:52:12 +01:00
Add a check for posix environment for pygments.
This commit is contained in:
parent
39a15a669a
commit
f89d887c21
1 changed files with 12 additions and 8 deletions
20
cheat
20
cheat
|
@ -2,14 +2,18 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
try:
|
||||
from pygments import highlight
|
||||
from pygments.util import ClassNotFound
|
||||
from pygments.lexers import get_lexer_for_filename, TextLexer
|
||||
from pygments.formatters import TerminalFormatter
|
||||
USE_PYGMENTS = True
|
||||
except ImportError:
|
||||
USE_PYGMENTS = False
|
||||
USE_PYGMENTS = False
|
||||
|
||||
# NOTE remove this check if it is confirmed to work on windows
|
||||
if os.name == 'posix':
|
||||
try:
|
||||
from pygments import highlight
|
||||
from pygments.util import ClassNotFound
|
||||
from pygments.lexers import get_lexer_for_filename, TextLexer
|
||||
from pygments.formatters import TerminalFormatter
|
||||
USE_PYGMENTS = True
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
def cheat_directories():
|
||||
|
|
Loading…
Reference in a new issue