Skip to content

Commit a3da19d

Browse files
committed
fix: remove useless catching binascii.Error
1 parent e2520a5 commit a3da19d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/joserfc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.0.4"
1+
__version__ = "1.1.0"
22
__homepage__ = "https://jose.authlib.org/en/"
33
__author__ = "Hsiaoming Yang <[email protected]>"
44
__license__ = "BSD-3-Clause"

src/joserfc/rfc7515/compact.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def extract_compact(value: bytes) -> CompactSignature:
3636

3737
try:
3838
payload = urlsafe_b64decode(payload_segment)
39-
except (TypeError, ValueError, binascii.Error):
39+
except (TypeError, ValueError):
4040
raise DecodeError("Invalid payload")
4141

4242
obj = CompactSignature(protected, payload)
@@ -54,7 +54,7 @@ def verify_compact(obj: CompactSignature, alg: JWSAlgModel, key: t.Any) -> bool:
5454
signing_input = obj.segments["header"] + b"." + obj.segments["payload"]
5555
try:
5656
sig = urlsafe_b64decode(obj.segments["signature"])
57-
except (TypeError, ValueError, binascii.Error):
57+
except (TypeError, ValueError):
5858
return False
5959
return alg.verify(signing_input, sig, key)
6060

0 commit comments

Comments
 (0)