Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Feb 19, 2024
1 parent 58e360e commit 5c8db02
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions jupyter_client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,10 @@ def send(
if isinstance(stream, zmq.asyncio.Socket):
assert stream is not None # type:ignore[unreachable]

async def send_multipart(*args, **kwargs):
async def _send_multipart(*args, **kwargs):
return await stream.send_multipart(*args, **kwargs)

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

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 is not None and buffers and track and not copy:
if stream 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 @@ -916,10 +916,10 @@ def send_raw(
if isinstance(stream, zmq.asyncio.Socket):
assert stream is not None

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

send_func = run_sync(send_multipart)
send_func = run_sync(_send_multipart)
else:
send_func = stream.send_multipart
send_func(to_send, flags, copy=copy)
Expand Down Expand Up @@ -949,10 +949,10 @@ def recv(

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

async def recv_multipart(*args: t.Any, **kwargs: t.Any) -> t.Any:
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)
recv_func = run_sync(_recv_multipart)
else:
recv_func = socket.recv_multipart

Expand Down

0 comments on commit 5c8db02

Please sign in to comment.