Simplified has_ghostscript

This commit is contained in:
Andrew Murray 2019-01-09 19:35:17 +11:00
parent 7bf5246b93
commit 93d4c692a5

View File

@ -53,9 +53,9 @@ if sys.platform.startswith('win'):
def has_ghostscript(): def has_ghostscript():
if gs_windows_binary: if gs_windows_binary is not None:
return True return gs_windows_binary is not False
if not sys.platform.startswith('win'): else:
import subprocess import subprocess
try: try:
with open(os.devnull, 'wb') as devnull: with open(os.devnull, 'wb') as devnull:
@ -63,8 +63,7 @@ def has_ghostscript():
return True return True
except OSError: except OSError:
# No Ghostscript # No Ghostscript
pass return False
return False
def Ghostscript(tile, size, fp, scale=1): def Ghostscript(tile, size, fp, scale=1):