From 4b08cf1257b65dd337d1729a6a9d322f8f89a576 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Wed, 1 Aug 2012 16:07:56 +0100 Subject: [PATCH] Move Python 3 import of reload() to the module that uses it. --- lib/matplotlib/__init__.py | 6 ++++++ lib/matplotlib/pyplot.py | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index caa16be9219b..04110d54abe7 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -106,6 +106,12 @@ import distutils.sysconfig import distutils.version +try: + reload +except NameError: + # Python 3 + from imp import reload + # Needed for toolkit setuptools support if 0: try: diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 8a9fe9606c91..d4223068d2e3 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -55,12 +55,6 @@ LinearLocator, LogLocator, AutoLocator, MultipleLocator,\ MaxNLocator -try: - reload -except NameError: - # Python 3 - from imp import reload - ## Backend detection ## def _backend_selection(): """ If rcParams['backend_fallback'] is true, check to see if the