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