mirror of
https://github.com/cheat/cheat.git
synced 2025-09-04 11:08:29 +02:00
Add a check for posix environment for pygments.
This commit is contained in:
6
cheat
6
cheat
@ -2,6 +2,10 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
USE_PYGMENTS = False
|
||||||
|
|
||||||
|
# NOTE remove this check if it is confirmed to work on windows
|
||||||
|
if os.name == 'posix':
|
||||||
try:
|
try:
|
||||||
from pygments import highlight
|
from pygments import highlight
|
||||||
from pygments.util import ClassNotFound
|
from pygments.util import ClassNotFound
|
||||||
@ -9,7 +13,7 @@ try:
|
|||||||
from pygments.formatters import TerminalFormatter
|
from pygments.formatters import TerminalFormatter
|
||||||
USE_PYGMENTS = True
|
USE_PYGMENTS = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
USE_PYGMENTS = False
|
pass
|
||||||
|
|
||||||
|
|
||||||
def cheat_directories():
|
def cheat_directories():
|
||||||
|
Reference in New Issue
Block a user