Show More
@@ -3029,11 +3029,6 class InteractiveShell(SingletonConfigurable): | |||
|
3029 | 3029 | # directly, so that the IPython crash handler doesn't get triggered |
|
3030 | 3030 | old_excepthook, sys.excepthook = sys.excepthook, self.excepthook |
|
3031 | 3031 | |
|
3032 | # Convenience function to set result.error_in_exec | |
|
3033 | def set_result_exc(value=None): | |
|
3034 | if result is not None: | |
|
3035 | result.error_in_exec = value if (value is not None) else sys.exc_info()[1] | |
|
3036 | ||
|
3037 | 3032 | # we save the original sys.excepthook in the instance, in case config |
|
3038 | 3033 | # code (such as magics) needs access to it. |
|
3039 | 3034 | self.sys_excepthook = old_excepthook |
@@ -3047,15 +3042,18 class InteractiveShell(SingletonConfigurable): | |||
|
3047 | 3042 | # Reset our crash handler in place |
|
3048 | 3043 | sys.excepthook = old_excepthook |
|
3049 | 3044 | except SystemExit as e: |
|
3050 |
|
|
|
3045 | if result is not None: | |
|
3046 | result.error_in_exec = e | |
|
3051 | 3047 | self.showtraceback(exception_only=True) |
|
3052 | 3048 | warn("To exit: use 'exit', 'quit', or Ctrl-D.", level=1) |
|
3053 | 3049 | except self.custom_exceptions: |
|
3054 | 3050 | etype, value, tb = sys.exc_info() |
|
3055 | set_result_exc(value) | |
|
3051 | if result is not None: | |
|
3052 | result.error_in_exec = value | |
|
3056 | 3053 | self.CustomTB(etype, value, tb) |
|
3057 | 3054 | except: |
|
3058 |
|
|
|
3055 | if result is not None: | |
|
3056 | result.error_in_exec = sys.exc_info()[1] | |
|
3059 | 3057 | self.showtraceback() |
|
3060 | 3058 | else: |
|
3061 | 3059 | outflag = 0 |
General Comments 0
You need to be logged in to leave comments.
Login now