diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 66ceee0..45ed4e2 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -3013,7 +3013,7 @@ class InteractiveShell(SingletonConfigurable): runner = _pseudo_sync_runner try: - return runner(coro) + result = runner(coro) except BaseException as e: info = ExecutionInfo( raw_cell, store_history, silent, shell_futures, cell_id @@ -3021,6 +3021,7 @@ class InteractiveShell(SingletonConfigurable): result = ExecutionResult(info) result.error_in_exec = e self.showtraceback(running_compiled_code=True) + finally: return result def should_run_async(