Skip to content

Commit 7463149

Browse files
author
natalieklein
committed
wrap import Image with try
1 parent f763ebe commit 7463149

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

surfer/viz.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ def make_montage(filename, fnames, orientation='h', colorbar=None,
7373
out : array
7474
The montage image data array.
7575
"""
76-
from PIL import Image
76+
try:
77+
import Image
78+
except ImportError:
79+
from PIL import Image
7780
# This line is only necessary to overcome a PIL bug, see:
7881
# http://stackoverflow.com/questions/10854903/what-is-causing-
7982
# dimension-dependent-attributeerror-in-pil-fromarray-function

0 commit comments

Comments
 (0)