From 65e522aa989e1ffb5a2bc5f6905dbea383899037 Mon Sep 17 00:00:00 2001 From: "Afshin T. Darian" Date: Tue, 30 Mar 2021 14:43:39 +0100 Subject: [PATCH] Revert Backport of #605: Fix Handling of shell.should_run_async --- ipykernel/ipkernel.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ipykernel/ipkernel.py b/ipykernel/ipkernel.py index ebbe42b34..9a85a02f2 100644 --- a/ipykernel/ipkernel.py +++ b/ipykernel/ipkernel.py @@ -278,16 +278,9 @@ def run_cell(*args, **kwargs): # default case: runner is asyncio and asyncio is already running # TODO: this should check every case for "are we inside the runner", # not just asyncio - preprocessing_exc_tuple = None - try: - transformed_cell = self.shell.transform_cell(code) - except Exception: - transformed_cell = code - preprocessing_exc_tuple = sys.exc_info() - if ( _asyncio_runner - and should_run_async(code, transformed_cell=transformed_cell, preprocessing_exc_tuple=preprocessing_exc_tuple) + and should_run_async(code) and shell.loop_runner is _asyncio_runner and asyncio.get_event_loop().is_running() ):