Skip to content

Commit 572a679

Browse files
authored
first attempt at resolving pylint warnings
1 parent 7b3019d commit 572a679

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_jwt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def validate(jwt):
7777
# Attempt to decode JOSE header
7878
try:
7979
jose_header = STRING_TOOLS.urlsafe_b64decode(jwt.split(".")[0])
80-
except UnicodeError:
81-
raise UnicodeError("Unable to decode JOSE header.")
80+
except UnicodeError as unicode_error:
81+
raise unicode_error("Unable to decode JOSE header.")
8282
# Check for typ and alg in decoded JOSE header
8383
if "typ" not in jose_header:
8484
raise TypeError("JOSE Header does not contain required type key.")
@@ -87,8 +87,8 @@ def validate(jwt):
8787
# Attempt to decode claim set
8888
try:
8989
claims = json.loads(STRING_TOOLS.urlsafe_b64decode(jwt.split(".")[1]))
90-
except UnicodeError:
91-
raise UnicodeError("Invalid claims encoding.")
90+
except UnicodeError as unicode_error:
91+
raise unicode_error("Invalid claims encoding.")
9292
if not hasattr(claims, "keys"):
9393
raise TypeError("Provided claims is not a JSON dict. object")
9494
return (jose_header, claims)

0 commit comments

Comments
 (0)