From 93d4c692a5d57da26c082a9ceb05d34878cce2a2 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 9 Jan 2019 19:35:17 +1100 Subject: [PATCH] Simplified has_ghostscript --- src/PIL/EpsImagePlugin.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/PIL/EpsImagePlugin.py b/src/PIL/EpsImagePlugin.py index cc2c1b1f8..33796ab07 100644 --- a/src/PIL/EpsImagePlugin.py +++ b/src/PIL/EpsImagePlugin.py @@ -53,9 +53,9 @@ if sys.platform.startswith('win'): def has_ghostscript(): - if gs_windows_binary: - return True - if not sys.platform.startswith('win'): + if gs_windows_binary is not None: + return gs_windows_binary is not False + else: import subprocess try: with open(os.devnull, 'wb') as devnull: @@ -63,8 +63,7 @@ def has_ghostscript(): return True except OSError: # No Ghostscript - pass - return False + return False def Ghostscript(tile, size, fp, scale=1):