From 47fb1b1d8695c917304c9ae4a44e1899df49972f Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 2 May 2018 15:12:26 +0300 Subject: [PATCH 1/3] Update classifiers --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index aceeff76..c8aec62a 100644 --- a/setup.py +++ b/setup.py @@ -45,9 +45,9 @@ def get_packages(package): 'Natural Language :: English', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', From ec7e03b778c8f6b47af4647d440b4838221a4e33 Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 2 May 2018 15:13:07 +0300 Subject: [PATCH 2/3] Replace function calls with set literals --- jose/constants.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jose/constants.py b/jose/constants.py index c446fd8d..eb146549 100644 --- a/jose/constants.py +++ b/jose/constants.py @@ -13,9 +13,9 @@ class Algorithms(object): ES384 = 'ES384' ES512 = 'ES512' - HMAC = set([HS256, HS384, HS512]) - RSA = set([RS256, RS384, RS512]) - EC = set([ES256, ES384, ES512]) + HMAC = {HS256, HS384, HS512} + RSA = {RS256, RS384, RS512} + EC = {ES256, ES384, ES512} SUPPORTED = HMAC.union(RSA).union(EC) From 6d458ef021f28cba01541e916435b9ec03f11dfd Mon Sep 17 00:00:00 2001 From: Hugo Date: Wed, 2 May 2018 15:14:06 +0300 Subject: [PATCH 3/3] Unnecessary list comprehension - 'any' can take a generator --- jose/jwk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jose/jwk.py b/jose/jwk.py index 0ae8b05a..345893d7 100644 --- a/jose/jwk.py +++ b/jose/jwk.py @@ -110,7 +110,7 @@ def __init__(self, key, 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 JWKError( 'The specified key is an asymmetric key or x509 certificate and' ' should not be used as an HMAC secret.')