ghostscript: choco doesn't put Ghostscript on PATH anymore

It seems that chocolately doesn't put gswin[32,64]c on PATH anymore,
so compensate.
This commit is contained in:
James R. Barlow
2021-11-13 01:18:12 -08:00
parent e3126d2806
commit 7b3d7ca92a
+8 -6
View File
@@ -10,6 +10,7 @@
import logging
import os
import re
import sys
from io import BytesIO
from os import fspath
from pathlib import Path
@@ -36,14 +37,15 @@ For details see:
---------------------------------------------------------------------
"""
# Most reliable what to get the bitness of Python interpreter, according to Python docs
_is_64bit = sys.maxsize > 2 ** 32
_gswin = None
if os.name == 'nt':
_gswin = which('gswin64c')
if not _gswin:
_gswin = which('gswin32c')
if not _gswin:
raise MissingDependencyError(missing_gs_error)
_gswin = Path(_gswin).stem
if _is_64bit:
_gswin = 'gswin64c'
else:
_gswin = 'gswin32c'
GS = _gswin if _gswin else 'gs'
del _gswin