From 46bf2fbe7275f6d7e6a99f07b7aa9d5d892432ea 2020-04-26 23:50:14 From: Matthias Bussonnier Date: 2020-04-26 23:50:14 Subject: [PATCH] Merge pull request #12262 from meeseeksmachine/auto-backport-of-pr-12261-on-7.x Backport PR #12261 on branch 7.x (Do not exit if self.interact is True) --- 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: