summaryrefslogtreecommitdiff
path: root/scripts/asciidoc2html.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-06-30 09:22:23 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-06-30 09:22:23 +0200
commit362d9d917ba0c796c2c8f9813e66634cae54b422 (patch)
tree98481b489441bfaedfc8e93466a24d09754cde01 /scripts/asciidoc2html.py
parentdb13e5283e2d20e83d348f15ea0f46c92e9f3e29 (diff)
downloadqutebrowser-362d9d917ba0c796c2c8f9813e66634cae54b422.tar.gz
qutebrowser-362d9d917ba0c796c2c8f9813e66634cae54b422.zip
Use Pygments from virtualenv's path in asciidoc2html
This allows running mkvenv.py without having Pygments installed system-wide. Prepending to the PATH (rather than appending) so that the virtualenv's one is always used, so the system-wide one can be older or broken.
Diffstat (limited to 'scripts/asciidoc2html.py')
-rwxr-xr-xscripts/asciidoc2html.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py
index 03ad8300c..e337c54db 100755
--- a/scripts/asciidoc2html.py
+++ b/scripts/asciidoc2html.py
@@ -251,9 +251,14 @@ class AsciiDoc:
cmdline += ['--out-file', str(dst)]
cmdline += args
cmdline.append(str(src))
+
+ # So the virtualenv's Pygments is found
+ bin_path = pathlib.Path(sys.executable).parent
+
try:
env = os.environ.copy()
env['HOME'] = str(self._homedir)
+ env['PATH'] = str(bin_path) + os.pathsep + env['PATH']
subprocess.run(cmdline, check=True, env=env)
except (subprocess.CalledProcessError, OSError) as e:
self._failed = True