From 83dead628b54805aa062ba755fb47e0b5dd56071 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Fri, 7 Nov 2014 15:56:16 -0500 Subject: [PATCH] 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. --- doc/api/api_changes/2014-11-07_remove_IMAGE.rst | 5 +++++ lib/matplotlib/backend_bases.py | 1 + 2 files changed, 6 insertions(+) create mode 100644 doc/api/api_changes/2014-11-07_remove_IMAGE.rst diff --git a/doc/api/api_changes/2014-11-07_remove_IMAGE.rst b/doc/api/api_changes/2014-11-07_remove_IMAGE.rst new file mode 100644 index 000000000000..74ef3d594d21 --- /dev/null +++ b/doc/api/api_changes/2014-11-07_remove_IMAGE.rst @@ -0,0 +1,5 @@ +Removed `Image` from main namespace +``````````````````````````````````` + +`Image` was imported from PIL/pillow to test if PIL is available, but there is no +reason to keep `Image` in the namespace once the availability has been determined. diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index 87c8686591ae..a346b67de4ce 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -68,6 +68,7 @@ def import_module(name): try: from PIL import Image _has_pil = True + del Image except ImportError: _has_pil = False