summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpygments/formatters/_mapping.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pygments/formatters/_mapping.py b/pygments/formatters/_mapping.py
index 4c05ac8e..8b3fc977 100755
--- a/pygments/formatters/_mapping.py
+++ b/pygments/formatters/_mapping.py
@@ -14,6 +14,13 @@
"""
from __future__ import print_function
+try:
+ import pygments
+except ImportError:
+ # This block makes this mapping work like the lexer one -- not requiring
+ # that Pygments already be on your PYTHONPATH.
+ import os.path, sys
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
# start
from pygments.formatters.bbcode import BBCodeFormatter