diff --git a/stripe/http_client.py b/stripe/http_client.py index f6a944df0..320089845 100644 --- a/stripe/http_client.py +++ b/stripe/http_client.py @@ -94,9 +94,9 @@ class HTTPClient(object): def __init__(self, verify_ssl_certs=True, proxy=None): self._verify_ssl_certs = verify_ssl_certs if proxy: - if type(proxy) is str: + if isinstance(proxy, str): proxy = {"http": proxy, "https": proxy} - if not (type(proxy) is dict): + if not isinstance(proxy, dict): raise ValueError( "Proxy(ies) must be specified as either a string " "URL or a dict() with string URL under the" diff --git a/stripe/oauth.py b/stripe/oauth.py index a25deafcb..027679389 100644 --- a/stripe/oauth.py +++ b/stripe/oauth.py @@ -39,16 +39,14 @@ def authorize_url(**params): @staticmethod def token(**params): requestor = api_requestor.APIRequestor(api_base=connect_api_base) - response, api_key = requestor.request( - "post", "/oauth/token", params, None - ) + response, _ = requestor.request("post", "/oauth/token", params, None) return response.data @staticmethod def deauthorize(**params): requestor = api_requestor.APIRequestor(api_base=connect_api_base) OAuth._set_client_id(params) - response, api_key = requestor.request( + response, _ = requestor.request( "post", "/oauth/deauthorize", params, None ) return response.data diff --git a/stripe/util.py b/stripe/util.py index b919c4b01..9076fc96d 100644 --- a/stripe/util.py +++ b/stripe/util.py @@ -225,7 +225,7 @@ def convert_to_stripe_object( ): global OBJECT_CLASSES - if len(OBJECT_CLASSES) == 0: + if not OBJECT_CLASSES: load_object_classes() types = OBJECT_CLASSES.copy() diff --git a/stripe/webhook.py b/stripe/webhook.py index 10fc9d470..f4d4e4f62 100644 --- a/stripe/webhook.py +++ b/stripe/webhook.py @@ -60,7 +60,7 @@ def verify_header(cls, payload, header, secret, tolerance=None): payload, ) - if len(signatures) == 0: + if not signatures: raise error.SignatureVerificationError( "No signatures found with expected scheme " "%s" % cls.EXPECTED_SCHEME,