Add a check for posix environment for pygments.

This commit is contained in:
Lars Yencken 2013-08-22 09:19:31 +10:00
parent 39a15a669a
commit f89d887c21
1 changed files with 12 additions and 8 deletions

6
cheat
View File

@ -2,6 +2,10 @@
import os
import sys
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
@ -9,7 +13,7 @@ try:
from pygments.formatters import TerminalFormatter
USE_PYGMENTS = True
except ImportError:
USE_PYGMENTS = False
pass
def cheat_directories():