Merge pull request #746 from cgohlke/patch-1

Fix build failure when compiler.include_dirs refers to nonexistent directory
This commit is contained in:
Alex Clark ☺ 2014-06-28 20:12:14 -04:00
commit 8dbc00643f

View File

@ -405,7 +405,12 @@ class pil_build_ext(build_ext):
# Find the best version
for directory in self.compiler.include_dirs:
for name in os.listdir(directory):
try:
listdir = os.listdir(directory)
except Exception:
# WindowsError, FileNotFoundError
continue
for name in listdir:
if name.startswith('openjpeg-') and \
os.path.isfile(os.path.join(directory, name,
'openjpeg.h')):