diff options
| author | Richard Marmorstein <richardm@stripe.com> | 2024-02-08 12:41:02 -0800 | 
|---|---|---|
| committer | Richard Marmorstein <richardm@stripe.com> | 2024-02-08 12:41:02 -0800 | 
| commit | e3b7205968c83bbf2e0200594118beac7a6d76c4 (patch) | |
| tree | 49a298259c535a469c2b691b8de1fd8c24d4e62f | |
| parent | 87f03f84a0d5a494b428d6a5a90cf098f4455764 (diff) | |
| -rw-r--r-- | stripe/_stripe_object.py | 5 | ||||
| -rw-r--r-- | tests/conftest.py | 1 | 
2 files changed, 2 insertions, 4 deletions
| diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index 36ac3c15..68a7314c 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -169,9 +169,8 @@ class StripeObject(Dict[str, Any]):  k = self._field_remappings[k]  return self[k]  except KeyError as err: - if stripe.absent_as_none: - if k in self.__annotations__: - return None + if stripe.absent_as_none and k in self.__annotations__: + return None  raise AttributeError(*err.args)  def __delattr__(self, k): diff --git a/tests/conftest.py b/tests/conftest.py index 26600ab7..6bd1ddf6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -73,7 +73,6 @@ def setup_stripe():  stripe.api_key = MOCK_API_KEY  stripe.client_id = "ca_123"  stripe.default_http_client = http_client - stripe.absent_as_none = True  yield  http_client.close()  stripe.api_base = orig_attrs["api_base"] | 
