From 34c78690a90ee2eec1d0e8c2149851327d1c45f1 2017-09-15 10:31:40 From: Thomas Kluyver Date: 2017-09-15 10:31:40 Subject: [PATCH] Exit code 1 if non-interactive execution fails Closes gh-10807 --- diff --git a/IPython/terminal/ipapp.py b/IPython/terminal/ipapp.py index 53be577..defe3e7 100755 --- a/IPython/terminal/ipapp.py +++ b/IPython/terminal/ipapp.py @@ -356,6 +356,8 @@ class TerminalIPythonApp(BaseIPythonApplication, InteractiveShellApp): self.shell.mainloop() else: self.log.debug("IPython not interactive...") + if not self.shell.last_execution_succeeded: + sys.exit(1) def load_default_config(ipython_dir=None): """Load the default config file from the default ipython_dir.