From 32aa8e4ad70265ee6a288593f63c871d3c175a18 2017-01-12 12:32:05 From: Matthias Bussonnier Date: 2017-01-12 12:32:05 Subject: [PATCH] Backport PR #9988: Exclude numpy._globals from deepreload Closes gh-9983, though not in a terribly satisfying way. Signed-off-by: Thomas Kluyver --- diff --git a/IPython/lib/deepreload.py b/IPython/lib/deepreload.py index 521acf3..0df9a2f 100644 --- a/IPython/lib/deepreload.py +++ b/IPython/lib/deepreload.py @@ -327,7 +327,8 @@ except AttributeError: original_reload = imp.reload # Python 3 # Replacement for reload() -def reload(module, exclude=('sys', 'os.path', builtin_mod_name, '__main__')): +def reload(module, exclude=('sys', 'os.path', builtin_mod_name, '__main__', + 'numpy._globals')): """Recursively reload all modules used in the given module. Optionally takes a list of modules to exclude from reloading. The default exclude list contains sys, __main__, and __builtin__, to prevent, e.g., resetting