8000 MNT : delete unused import of Image · matplotlib/matplotlib@83dead6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 83dead6

Browse files
committed
MNT : delete unused import of Image
We only import Image to see if PIL/pillow is available to decide if we should register jpg/tiff support for FigureCanvasBase. Technically an API break, but anyone who was relying on this probably deserves what they get.
1 parent cf4f332 commit 83dead6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Removed `Image` from main namespace
2+
```````````````````````````````````
3+
4+
`Image` was imported from PIL/pillow to test if PIL is available, but there is no
5+
reason to keep `Image` in the namespace once the availability has been determined.

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def import_module(name):
6868
try:
6969
from PIL import Image
7070
_has_pil = True
71+
del Image
7172
except ImportError:
7273
_has_pil = False
7374

0 commit comments

Comments
 (0)
0