Merge pull request #32 from KOLANICH/ghostscript_discovery_win

Fixed library discovery on Windows
pull/48/head
Dimiter Naydenov 2019-07-24 13:38:51 +03:00 committed by GitHub
commit 6d33c7ff1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -243,6 +243,9 @@ def __win32_finddll():
if sys.platform == "win32": if sys.platform == "win32":
libgs = __win32_finddll() libgs = __win32_finddll()
if not libgs:
import ctypes.util
libgs = ctypes.util.find_library("".join(("gsdll", str(ctypes.sizeof(ctypes.c_voidp) * 8), ".dll"))) # finds in %PATH%
if not libgs: if not libgs:
raise RuntimeError("Please make sure that Ghostscript is installed") raise RuntimeError("Please make sure that Ghostscript is installed")
libgs = windll.LoadLibrary(libgs) libgs = windll.LoadLibrary(libgs)