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