Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 7, 2022
1 parent 4e5b833 commit 0b9ddbd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion ipykernel/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from threading import Thread



class ControlThread(Thread):
def __init__(self, **kwargs):
Thread.__init__(self, name="Control", **kwargs)
Expand Down
5 changes: 4 additions & 1 deletion ipykernel/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import zmq
from jupyter_client.session import extract_header

from .zmqstream import ZMQStream

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -458,7 +459,9 @@ def _schedule_flush(self):
def _schedule_in_thread():
# FIXME: original code was:
# self._io_loop.call_later(self.flush_interval, self._flush)
self._io_loop.call_soon_threadsafe(self._io_loop.call_later, self.flush_interval, self._flush)
self._io_loop.call_soon_threadsafe(
self._io_loop.call_later, self.flush_interval, self._flush
)

self.pub_thread.schedule(_schedule_in_thread)

Expand Down
4 changes: 1 addition & 3 deletions ipykernel/ipkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ def start(self):
self.debugpy_stream.on_recv(self.dispatch_debugpy, copy=False)
super().start()
if self.debugpy_stream:
asyncio.run_coroutine_threadsafe(
self.poll_stopped_queue(), self.control_thread.io_loop
)
asyncio.run_coroutine_threadsafe(self.poll_stopped_queue(), self.control_thread.io_loop)

def set_parent(self, ident, parent, channel="shell"):
"""Overridden from parent to tell the display hook and output streams
Expand Down
1 change: 0 additions & 1 deletion ipykernel/kernelapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import zmq
import zmq.asyncio

from IPython.core.application import (
BaseIPythonApplication,
base_aliases,
Expand Down
4 changes: 3 additions & 1 deletion ipykernel/trio_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def initialize(self, kernel, io_loop):
kernel.shell.magics_manager.magics["line"]["autoawait"] = lambda _: warnings.warn(
"Autoawait isn't allowed in Trio background loop mode."
)
bg_thread = threading.Thread(target=io_loop.run_forever, daemon=True, name="AsyncioBackground")
bg_thread = threading.Thread(
target=io_loop.run_forever, daemon=True, name="AsyncioBackground"
)
bg_thread.start()

def interrupt(self, signum, frame):
Expand Down

0 comments on commit 0b9ddbd

Please sign in to comment.