diff options
Diffstat (limited to 'scripts/find_error.py')
-rwxr-xr-x | scripts/find_error.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/find_error.py b/scripts/find_error.py index 8e4c79db..00923569 100755 --- a/scripts/find_error.py +++ b/scripts/find_error.py @@ -14,11 +14,10 @@ import sys, os -try: - import pygments -except ImportError: - # try parent path - sys.path.append(os.path.join(os.path.dirname(__file__), '..')) +# always prefer Pygments from source if exists +srcpath = os.path.join(os.path.dirname(__file__), '..') +if os.path.isdir(os.path.join(srcpath, 'pygments')): + sys.path.insert(0, srcpath) from pygments.lexer import RegexLexer |