Skip to content

Commit

Permalink
Merge pull request #939 from blink1073/fix-mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored May 23, 2022
2 parents a43c21a + 944bfd9 commit 3f9ed67
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ipykernel/inprocess/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def recv_multipart(self, flags=0, copy=True, track=False):
return self.queue.get_nowait()

def send_multipart(self, msg_parts, flags=0, copy=True, track=False):
msg_parts = list(map(zmq.Message, msg_parts)) # type:ignore[arg-type]
msg_parts = list(map(zmq.Message, msg_parts))
self.queue.put_nowait(msg_parts)
self.message_sent += 1

Expand Down
4 changes: 2 additions & 2 deletions ipykernel/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from binascii import b2a_hex
from collections import deque
from io import StringIO, TextIOBase
from typing import Any, Callable, Optional
from typing import Any, Callable, Deque, Optional
from weakref import WeakSet

import zmq
Expand Down Expand Up @@ -67,7 +67,7 @@ def __init__(self, socket, pipe=False):
if pipe:
self._setup_pipe_in()
self._local = threading.local()
self._events: deque[Callable[..., Any]] = deque()
self._events: Deque[Callable[..., Any]] = deque()
self._event_pipes: WeakSet[Any] = WeakSet()
self._setup_event_pipe()
self.thread = threading.Thread(target=self._thread_main, name="IOPub")
Expand Down
4 changes: 1 addition & 3 deletions ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,9 +1197,7 @@ def _input_request(self, prompt, ident, parent, password=False):
# zmq.select() is also uninterruptible, but at least this
# way reads get noticed immediately and KeyboardInterrupts
# get noticed fairly quickly by human response time standards.
rlist, _, xlist = zmq.select(
[self.stdin_socket], [], [self.stdin_socket], 0.01 # type:ignore[arg-type]
)
rlist, _, xlist = zmq.select([self.stdin_socket], [], [self.stdin_socket], 0.01)
if rlist or xlist:
ident, reply = self.session.recv(self.stdin_socket)
if (ident, reply) != (None, None):
Expand Down

0 comments on commit 3f9ed67

Please sign in to comment.