From 1d521e630f9dcf1bf1053209f8ecd88ece666f69 2017-12-14 11:38:20 From: Thomas Kluyver Date: 2017-12-14 11:38:20 Subject: [PATCH] Merge pull request #10944 from rmrao/master make sure module actually has __name__ attribute --- diff --git a/IPython/extensions/autoreload.py b/IPython/extensions/autoreload.py index a248c1d..2993852 100644 --- a/IPython/extensions/autoreload.py +++ b/IPython/extensions/autoreload.py @@ -184,7 +184,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