Skip to content

Commit

Permalink
Use generator expressions (#569)
Browse files Browse the repository at this point in the history
Avoids building a list in memory unnecessarily. Generator expressions
are evaluated lazily.
  • Loading branch information
jdufresne committed Dec 21, 2020
1 parent 5ddab7c commit 9a20ab3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jwt/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def prepare_key(self, key):
b"ssh-rsa",
]

if any([string_value in key for string_value in invalid_strings]):
if any(string_value in key for string_value in invalid_strings):
raise InvalidKeyError(
"The specified key is an asymmetric key or x509 certificate and"
" should not be used as an HMAC secret."
Expand Down

0 comments on commit 9a20ab3

Please sign in to comment.