summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-01-09 16:14:46 +0100
committerGeorg Brandl <georg@python.org>2013-01-09 16:14:46 +0100
commit80cc5970648da80c87364379fdbfc4c0827505f7 (patch)
treef5b6f2c447813a40963644b96cf52cb9dbadf25d /scripts
parent49dc2316fa703bcef00dc0a97f3583f4d2c37fc4 (diff)
downloadpygments-80cc5970648da80c87364379fdbfc4c0827505f7.tar.gz
find_error: always prefer Pygments from source dir.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/find_error.py9
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