Skip to content

Commit

Permalink
Revert Backport of #605: Fix Handling of shell.should_run_async
Browse files Browse the repository at this point in the history
  • Loading branch information
afshin committed Mar 30, 2021
1 parent 7b3187d commit 65e522a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions ipykernel/ipkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
):
Expand Down

0 comments on commit 65e522a

Please sign in to comment.