diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-12-21 08:40:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 11:40:57 -0500 |
commit | 9a20ab3f7011e0afaf148264764fdefb8669e9a7 (patch) | |
tree | 6a96242c0eb288bf4b1faf8f8edab9fb9749b15e | |
parent | 5ddab7cab47872fb3f470f8b4e8a65941638ac40 (diff) | |
download | pyjwt-9a20ab3f7011e0afaf148264764fdefb8669e9a7.tar.gz |
Use generator expressions (#569)
Avoids building a list in memory unnecessarily. Generator expressions
are evaluated lazily.
-rw-r--r-- | jwt/algorithms.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/jwt/algorithms.py b/jwt/algorithms.py index 35e43bf..9f16701 100644 --- a/jwt/algorithms.py +++ b/jwt/algorithms.py @@ -180,7 +180,7 @@ class HMACAlgorithm(Algorithm): 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." |