From a3b517a7d70d86c26e5986c7073a23cf0c1e2e65 2017-12-14 11:53:54 From: Thomas Kluyver Date: 2017-12-14 11:53:54 Subject: [PATCH] Merge pull request #10945 from ipython/auto-backport-of-pr-10944 Backport PR #10944 on branch 5.x --- diff --git a/IPython/extensions/autoreload.py b/IPython/extensions/autoreload.py index 2d0894f..d3e4205 100644 --- a/IPython/extensions/autoreload.py +++ b/IPython/extensions/autoreload.py @@ -186,7 +186,7 @@ class ModuleReloader(object): if not hasattr(module, '__file__') or module.__file__ is None: return None, None - if getattr(module, '__name__', None) in ['__mp_main__', '__main__']: + if getattr(module, '__name__', None) in [None, '__mp_main__', '__main__']: # we cannot reload(__main__) or reload(__mp_main__) return None, None