From caba4e33bac66c1271912535ba85f835f0d7f006 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Fri, 8 Mar 2013 11:15:28 -0800 Subject: [PATCH] Fix AttributeError: 'module' object has no attribute 'spawn' --- PIL/EpsImagePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PIL/EpsImagePlugin.py b/PIL/EpsImagePlugin.py index 2cf0e8a8c..bc0ed43c5 100644 --- a/PIL/EpsImagePlugin.py +++ b/PIL/EpsImagePlugin.py @@ -35,13 +35,13 @@ field = re.compile(r"^%[%!\w]([^:]*)[ \t]*$") gs_windows_binary = None import sys -if sys.platform[:3].lower() == 'win': +if sys.platform.startswith('win'): import shutil if hasattr(shutil, 'which'): which = shutil.which else: # Python < 3.3 - import distutils + import distutils.spawn which = distutils.spawn.find_executable for binary in ('gswin32c', 'gswin64c', 'gs'): if which(binary) is not None: