Skip to content

Commit a7bb0d0

Browse files
committed
Run pre-commit run -a to upgrade Python syntax
1 parent e2b2a26 commit a7bb0d0

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

jwt/api_jwk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import json
44
import time
5-
from typing import Any, Iterator
5+
from collections.abc import Iterator
6+
from typing import Any
67

78
from .algorithms import get_default_algorithms, has_crypto, requires_cryptography
89
from .exceptions import (

jwt/api_jwt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import os
55
import warnings
66
from calendar import timegm
7-
from collections.abc import Iterable, Sequence
7+
from collections.abc import Container, Iterable, Sequence
88
from datetime import datetime, timedelta, timezone
9-
from typing import TYPE_CHECKING, Any, Container
9+
from typing import TYPE_CHECKING, Any
1010

1111
from . import api_jws
1212
from .exceptions import (

jwt/help.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import json
22
import platform
33
import sys
4-
from typing import Dict
54

65
from . import __version__ as pyjwt_version
76

@@ -13,7 +12,7 @@
1312
cryptography_version = ""
1413

1514

16-
def info() -> Dict[str, Dict[str, str]]:
15+
def info() -> dict[str, dict[str, str]]:
1716
"""
1817
Generate information for a bug report.
1918
Based on the requests package help utility module.

jwt/jwks_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import urllib.request
55
from functools import lru_cache
66
from ssl import SSLContext
7-
from typing import Any, Dict, List, Optional
7+
from typing import Any
88
from urllib.error import URLError
99

1010
from .api_jwk import PyJWK, PyJWKSet
@@ -21,14 +21,14 @@ def __init__(
2121
max_cached_keys: int = 16,
2222
cache_jwk_set: bool = True,
2323
lifespan: float = 300,
24-
headers: Optional[Dict[str, Any]] = None,
24+
headers: dict[str, Any] | None = None,
2525
timeout: float = 30,
26-
ssl_context: Optional[SSLContext] = None,
26+
ssl_context: SSLContext | None = None,
2727
):
2828
if headers is None:
2929
headers = {}
3030
self.uri = uri
31-
self.jwk_set_cache: Optional[JWKSetCache] = None
31+
self.jwk_set_cache: JWKSetCache | None = None
3232
self.headers = headers
3333
self.timeout = timeout
3434
self.ssl_context = ssl_context
@@ -82,7 +82,7 @@ def get_jwk_set(self, refresh: bool = False) -> PyJWKSet:
8282

8383
return PyJWKSet.from_dict(data)
8484

85-
def get_signing_keys(self, refresh: bool = False) -> List[PyJWK]:
85+
def get_signing_keys(self, refresh: bool = False) -> list[PyJWK]:
8686
jwk_set = self.get_jwk_set(refresh)
8787
signing_keys = [
8888
jwk_set_key
@@ -117,7 +117,7 @@ def get_signing_key_from_jwt(self, token: str | bytes) -> PyJWK:
117117
return self.get_signing_key(header.get("kid"))
118118

119119
@staticmethod
120-
def match_kid(signing_keys: List[PyJWK], kid: str) -> Optional[PyJWK]:
120+
def match_kid(signing_keys: list[PyJWK], kid: str) -> PyJWK | None:
121121
signing_key = None
122122

123123
for key in signing_keys:

jwt/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from typing import Any, Callable, Dict, TypedDict
1+
from typing import Any, Callable, TypedDict
22

3-
JWKDict = Dict[str, Any]
3+
JWKDict = dict[str, Any]
44

55
HashlibHash = Callable[..., Any]
66

0 commit comments

Comments
 (0)