Skip to content

Commit

Permalink
Remove direct use of asyncio (#1266)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart authored Sep 10, 2024
1 parent 1ca8f2c commit 0fa5439
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions ipykernel/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.

import asyncio
import atexit
import contextvars
import io
Expand Down Expand Up @@ -99,7 +98,6 @@ def __init__(self, socket, pipe=False):
self._event_pipes: Dict[threading.Thread, Any] = {}
self._event_pipe_gc_lock: threading.Lock = threading.Lock()
self._event_pipe_gc_seconds: float = 10
self._event_pipe_gc_task: Optional[asyncio.Task[Any]] = None
self._setup_event_pipe()
tasks = [self._handle_event, self._run_event_pipe_gc]
if pipe:
Expand Down
3 changes: 1 addition & 2 deletions ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Distributed under the terms of the Modified BSD License.
from __future__ import annotations

import asyncio
import inspect
import itertools
import logging
Expand Down Expand Up @@ -1258,7 +1257,7 @@ async def _progressively_terminate_all_children(self):
delay,
children,
)
await asyncio.sleep(delay)
await sleep(delay)

async def _at_shutdown(self):
"""Actions taken at shutdown by the kernel, called by python's atexit."""
Expand Down

0 comments on commit 0fa5439

Please sign in to comment.