Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Feb 18, 2024
1 parent 642b145 commit 58e360e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions jupyter_client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ async def send_multipart(*args, **kwargs):
return await stream.send_multipart(*args, **kwargs)

send_func = run_sync(send_multipart)
else:
elif stream is not None:
send_func = stream.send_multipart

if isinstance(msg_or_type, (Message, dict)):
Expand Down Expand Up @@ -861,7 +861,7 @@ async def send_multipart(*args, **kwargs):
longest = max([len(s) for s in to_send])
copy = longest < self.copy_threshold

if stream and buffers and track and not copy:
if stream is not None and buffers and track and not copy:
# only really track when we are doing zero-copy buffers
tracker = send_func(to_send, copy=False, track=True)
elif stream:
Expand Down Expand Up @@ -914,10 +914,10 @@ def send_raw(
to_send.append(self.sign(msg_list[0:4]))
to_send.extend(msg_list)
if isinstance(stream, zmq.asyncio.Socket):
assert stream is not None # type:ignore[unreachable]
assert stream is not None

async def send_multipart(*args, **kwargs):
return await stream.send_multipart(*args, **kwargs)
async def send_multipart(*args: t.Any, **kwargs: t.Any) -> None:
await stream.send_multipart(*args, **kwargs)

send_func = run_sync(send_multipart)
else:
Expand Down Expand Up @@ -949,7 +949,7 @@ def recv(

if isinstance(socket, zmq.asyncio.Socket):

async def recv_multipart(*args, **kwargs):
async def recv_multipart(*args: t.Any, **kwargs: t.Any) -> t.Any:
return await socket.recv_multipart(*args, **kwargs)

recv_func = run_sync(recv_multipart)
Expand Down

0 comments on commit 58e360e

Please sign in to comment.