diff --git a/IPython/core/shellapp.py b/IPython/core/shellapp.py index 33052c4..9e8bfbf 100644 --- a/IPython/core/shellapp.py +++ b/IPython/core/shellapp.py @@ -418,7 +418,8 @@ class InteractiveShellApp(Configurable): fname = os.path.join(fname, "__main__.py") if not os.path.exists(fname): self.log.warning("File '%s' doesn't exist", fname) - self.exit(2) + if not self.interact: + self.exit(2) try: self._exec_file(fname, shell_futures=True) except: