Skip to content

Commit

Permalink
dont allow repeated patching
Browse files Browse the repository at this point in the history
  • Loading branch information
smacke committed May 25, 2023
1 parent 2649b72 commit 8bc645f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jupyter_core/utils/patched_nest_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def step(task, exc=None):
curr_tasks[task._loop] = curr_task

Task = asyncio.Task
if hasattr(Task, '_nest_patched'):
return
if sys.version_info >= (3, 7, 0):

def enter_task(loop, task):
Expand All @@ -52,3 +54,4 @@ def leave_task(loop, task):
except AttributeError:
step_orig = Task._step # type: ignore
Task._step = step # type: ignore
Task._nest_patched = True # type: ignore

0 comments on commit 8bc645f

Please sign in to comment.