Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aabb275

Browse files
committed
Merged revisions 8939 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v1_0_maint ........ r8939 | mdboom | 2011-02-01 11:02:54 -0500 (Tue, 01 Feb 2011) | 1 line [3167200] Use from PIL import Image ........ svn path=/trunk/matplotlib/; revision=8942
1 parent e8d2098 commit aabb275

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

examples/pylab_examples/image_demo3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
from pylab import *
33
try:
4-
import Image
4+
from PIL import Image
55
except ImportError, exc:
66
raise SystemExit("PIL must be installed to run this example")
77

examples/pylab_examples/to_numeric.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pylab import *
99
from matplotlib.backends.backend_agg import FigureCanvasAgg
1010
try:
11-
import Image
11+
from PIL import Image
1212
except ImportError, exc:
1313
raise SystemExit("PIL must be installed to run this example")
1414

examples/user_interfaces/histogram_demo_canvasagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
if 0:
5656
# pass off to PIL
57-
import Image
57+
from PIL import Image
5858
im = Image.fromstring( "RGB", (w,h), s)
5959
im.show()
6060

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from matplotlib.path import Path
5050

5151
try:
52-
import Image
52+
from PIL import Image
5353
_has_pil = True
5454
except ImportError:
5555
_has_pil = False

lib/matplotlib/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ def imread(fname, format=None):
11571157

11581158
def pilread():
11591159
'try to load the image with PIL or return None'
1160-
try: import Image
1160+
try: from PIL import Image
11611161
except ImportError: return None
11621162
image = Image.open( fname )
11631163
return pil_to_array(image)

0 commit comments

Comments
 (0)