Skip to content

Commit

Permalink
fix(mypy): apply mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianMaurin authored and JulianMaurin committed Aug 2, 2022
1 parent 48bff7d commit bd8404c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions jwt/help.py
Expand Up @@ -8,7 +8,7 @@
try:
import cryptography
except ModuleNotFoundError:
cryptography = None # type: ignore
cryptography = None


def info() -> Dict[str, Dict[str, str]]:
Expand All @@ -29,14 +29,15 @@ def info() -> Dict[str, Dict[str, str]]:
if implementation == "CPython":
implementation_version = platform.python_version()
elif implementation == "PyPy":
pypy_version_info = getattr(sys, "pypy_version_info")
implementation_version = (
f"{sys.pypy_version_info.major}." # type: ignore[attr-defined]
f"{sys.pypy_version_info.minor}."
f"{sys.pypy_version_info.micro}"
f"{pypy_version_info.major}."
f"{pypy_version_info.minor}."
f"{pypy_version_info.micro}"
)
if sys.pypy_version_info.releaselevel != "final": # type: ignore[attr-defined]
if pypy_version_info.releaselevel != "final":
implementation_version = "".join(
[implementation_version, sys.pypy_version_info.releaselevel] # type: ignore[attr-defined]
[implementation_version, pypy_version_info.releaselevel]
)
else:
implementation_version = "Unknown"
Expand Down
4 changes: 2 additions & 2 deletions jwt/utils.py
@@ -1,7 +1,7 @@
import base64
import binascii
import re
from typing import Any, Union
from typing import Union

try:
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurve
Expand All @@ -10,7 +10,7 @@
encode_dss_signature,
)
except ModuleNotFoundError:
EllipticCurve = Any # type: ignore
EllipticCurve = None


def force_bytes(value: Union[str, bytes]) -> bytes:
Expand Down

0 comments on commit bd8404c

Please sign in to comment.