Skip to content

Commit 7d374f9

Browse files
committed
fix pre-commit after bump to 3.10
1 parent d2b430c commit 7d374f9

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

jupyter_client/connect.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def tunnel_to_kernel(
293293
else:
294294
password = getpass("SSH Password for %s: " % sshserver)
295295

296-
for lp, rp in zip(lports, rports):
296+
for lp, rp in zip(lports, rports, strict=False):
297297
tunnel.ssh_tunnel(lp, rp, sshserver, remote_ip, sshkey, password)
298298

299299
return tuple(lports)
@@ -717,9 +717,9 @@ def return_port(self, port: int) -> None:
717717

718718

719719
__all__ = [
720-
"write_connection_file",
721-
"find_connection_file",
722-
"tunnel_to_kernel",
723720
"KernelConnectionInfo",
724721
"LocalPortCache",
722+
"find_connection_file",
723+
"tunnel_to_kernel",
724+
"write_connection_file",
725725
]

jupyter_client/jsonutil.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def extract_dates(obj: Any) -> Any:
7474
for k, v in obj.items():
7575
new_obj[k] = extract_dates(v)
7676
obj = new_obj
77-
elif isinstance(obj, (list, tuple)):
77+
elif isinstance(obj, list | tuple):
7878
obj = [extract_dates(o) for o in obj]
7979
elif isinstance(obj, str):
8080
obj = parse_date(obj)
@@ -87,7 +87,7 @@ def squash_dates(obj: Any) -> Any:
8787
obj = dict(obj) # don't clobber
8888
for k, v in obj.items():
8989
obj[k] = squash_dates(v)
90-
elif isinstance(obj, (list, tuple)):
90+
elif isinstance(obj, list | tuple):
9191
obj = [squash_dates(o) for o in obj]
9292
elif isinstance(obj, datetime):
9393
obj = obj.isoformat()
@@ -188,7 +188,7 @@ def json_clean(obj: Any) -> Any:
188188
out[str(k)] = json_clean(v)
189189
return out
190190

191-
if isinstance(obj, (datetime, date)):
191+
if isinstance(obj, datetime | date):
192192
return obj.strftime(ISO8601)
193193

194194
# we don't understand it, it's probably an unserializable object

jupyter_client/localinterfaces.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import re
88
import socket
99
import subprocess
10-
from collections.abc import Iterable, Mapping, Sequence
10+
from collections.abc import Callable, Iterable, Mapping, Sequence
1111
from subprocess import PIPE, Popen
12-
from typing import Any, Callable
12+
from typing import Any
1313
from warnings import warn
1414

1515
LOCAL_IPS: list[str] = []

jupyter_client/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ def send(
814814
assert stream is not None # type:ignore[unreachable]
815815
stream = zmq.Socket.shadow(stream.underlying)
816816

817-
if isinstance(msg_or_type, (Message, dict)):
817+
if isinstance(msg_or_type, Message | dict):
818818
# We got a Message or message dict, not a msg_type so don't
819819
# build a new Message.
820820
msg = msg_or_type

jupyter_client/ssh/tunnel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,9 @@ def _paramiko_tunnel(
438438

439439

440440
__all__ = [
441-
"tunnel_connection",
442-
"ssh_tunnel",
443441
"openssh_tunnel",
444442
"paramiko_tunnel",
443+
"ssh_tunnel",
445444
"try_passwordless_ssh",
445+
"tunnel_connection",
446446
]

0 commit comments

Comments
 (0)