From 9f1c67cba4247da319e4d11228476a6d4710507b 2017-05-10 17:16:19 From: Thomas Kluyver Date: 2017-05-10 17:16:19 Subject: [PATCH] Backport PR #10523: Don't reload __mp_main__ Fixes 10522. --- diff --git a/IPython/extensions/autoreload.py b/IPython/extensions/autoreload.py index 60d9572..2d0894f 100644 --- a/IPython/extensions/autoreload.py +++ b/IPython/extensions/autoreload.py @@ -186,8 +186,8 @@ class ModuleReloader(object): if not hasattr(module, '__file__') or module.__file__ is None: return None, None - if getattr(module, '__name__', None) == '__main__': - # we cannot reload(__main__) + if getattr(module, '__name__', None) in ['__mp_main__', '__main__']: + # we cannot reload(__main__) or reload(__mp_main__) return None, None filename = module.__file__