diff --git a/IPython/extensions/autoreload.py b/IPython/extensions/autoreload.py index 8459dc7..60d9572 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 module.__name__ == '__main__': + if getattr(module, '__name__', None) == '__main__': # we cannot reload(__main__) return None, None