diff options
Diffstat (limited to 'scripts/find_error.py')
-rwxr-xr-x | scripts/find_error.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/scripts/find_error.py b/scripts/find_error.py index 453f16ed..00923569 100755 --- a/scripts/find_error.py +++ b/scripts/find_error.py @@ -8,17 +8,16 @@ the text where Error tokens are being generated, along with some context. - :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ 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 |