##// END OF EJS Templates
Set exit code on script errors....
Fairly -
Show More
@@ -2675,10 +2675,11 b' class InteractiveShell(SingletonConfigurable):'
2675 # 0
2675 # 0
2676 # For other exit status, we show the exception unless
2676 # For other exit status, we show the exception unless
2677 # explicitly silenced, but only in short form.
2677 # explicitly silenced, but only in short form.
2678 if kw['raise_exceptions']:
2678 if status.code:
2679 raise
2679 if kw['raise_exceptions']:
2680 if status.code and not kw['exit_ignore']:
2680 raise
2681 self.showtraceback(exception_only=True)
2681 if not kw['exit_ignore']:
2682 self.showtraceback(exception_only=True)
2682 except:
2683 except:
2683 if kw['raise_exceptions']:
2684 if kw['raise_exceptions']:
2684 raise
2685 raise
@@ -345,7 +345,8 b' class InteractiveShellApp(Configurable):'
345 # default to python, even without extension
345 # default to python, even without extension
346 self.shell.safe_execfile(full_filename,
346 self.shell.safe_execfile(full_filename,
347 self.shell.user_ns,
347 self.shell.user_ns,
348 shell_futures=shell_futures)
348 shell_futures=shell_futures,
349 raise_exceptions=True)
349 finally:
350 finally:
350 sys.argv = save_argv
351 sys.argv = save_argv
351
352
@@ -415,9 +416,8 b' class InteractiveShellApp(Configurable):'
415 try:
416 try:
416 self._exec_file(fname, shell_futures=True)
417 self._exec_file(fname, shell_futures=True)
417 except:
418 except:
418 self.log.warn("Error in executing file in user namespace: %s" %
419 self.shell.showtraceback(tb_offset=4)
419 fname)
420 self.exit(1)
420 self.shell.showtraceback()
421
421
422 def _run_module(self):
422 def _run_module(self):
423 """Run module specified at the command-line."""
423 """Run module specified at the command-line."""
General Comments 0
You need to be logged in to leave comments. Login now