summaryrefslogtreecommitdiff
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-07-10 16:17:04 +0200
commit8ade7d22f23db3758f4a2eb11d73e1cb923fef00 (patch)
treea0d3f98c786388fe7eddda57b87c5388e58e810a
parenta4e40d97dc6fdae0ef11e9636a6fc34c1092a236 (diff)
downloadqutebrowser-8ade7d22f23db3758f4a2eb11d73e1cb923fef00.tar.gz
qutebrowser-8ade7d22f23db3758f4a2eb11d73e1cb923fef00.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. (cherry picked from commit 362d9d917ba0c796c2c8f9813e66634cae54b422)
-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