Skip to content

Commit

Permalink
Merge pull request python-pillow#746 from cgohlke/patch-1
Browse files Browse the repository at this point in the history
Fix build failure when compiler.include_dirs refers to nonexistent directory
  • Loading branch information
aclark4life committed Jun 29, 2014
2 parents 2633408 + 526ac7e commit 8dbc006
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,12 @@ def build_extensions(self):

# 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')):
Expand Down

0 comments on commit 8dbc006

Please sign in to comment.