Show More
@@ -2696,6 +2696,8 b' class InteractiveShell(SingletonConfigurable):' | |||
|
2696 | 2696 | result.execution_count = self.execution_count |
|
2697 | 2697 | |
|
2698 | 2698 | def error_before_exec(value): |
|
2699 | if store_history: | |
|
2700 | self.execution_count += 1 | |
|
2699 | 2701 | result.error_before_exec = value |
|
2700 | 2702 | self.last_execution_succeeded = False |
|
2701 | 2703 | self.last_execution_result = result |
@@ -2752,33 +2754,25 b' class InteractiveShell(SingletonConfigurable):' | |||
|
2752 | 2754 | |
|
2753 | 2755 | with self.display_trap: |
|
2754 | 2756 | # Compile to bytecode |
|
2755 | ast_error = None | |
|
2756 | 2757 | try: |
|
2757 | 2758 | code_ast = compiler.ast_parse(cell, filename=cell_name) |
|
2758 | 2759 | except self.custom_exceptions as e: |
|
2759 | 2760 | etype, value, tb = sys.exc_info() |
|
2760 | 2761 | self.CustomTB(etype, value, tb) |
|
2761 |
|
|
|
2762 | return error_before_exec(e) | |
|
2762 | 2763 | except IndentationError as e: |
|
2763 | 2764 | self.showindentationerror() |
|
2764 |
|
|
|
2765 | return error_before_exec(e) | |
|
2765 | 2766 | except (OverflowError, SyntaxError, ValueError, TypeError, |
|
2766 | 2767 | MemoryError) as e: |
|
2767 | 2768 | self.showsyntaxerror() |
|
2768 |
|
|
|
2769 | ||
|
2770 | if ast_error is not None: | |
|
2771 | if store_history: | |
|
2772 | self.execution_count += 1 | |
|
2773 | return error_before_exec(ast_error) | |
|
2769 | return error_before_exec(e) | |
|
2774 | 2770 | |
|
2775 | 2771 | # Apply AST transformations |
|
2776 | 2772 | try: |
|
2777 | 2773 | code_ast = self.transform_ast(code_ast) |
|
2778 | 2774 | except InputRejected as e: |
|
2779 | 2775 | self.showtraceback() |
|
2780 | if store_history: | |
|
2781 | self.execution_count += 1 | |
|
2782 | 2776 | return error_before_exec(e) |
|
2783 | 2777 | |
|
2784 | 2778 | # Give the displayhook a reference to our ExecutionResult so it |
General Comments 0
You need to be logged in to leave comments.
Login now