checkout-intents 0.3.1__py3-none-any.whl → 0.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -54,11 +54,12 @@ class Stream(Generic[_T]):
54
54
  process_data = self._client._process_response_data
55
55
  iterator = self._iter_events()
56
56
 
57
- for sse in iterator:
58
- yield process_data(data=sse.json(), cast_to=cast_to, response=response)
59
-
60
- # As we might not fully consume the response stream, we need to close it explicitly
61
- response.close()
57
+ try:
58
+ for sse in iterator:
59
+ yield process_data(data=sse.json(), cast_to=cast_to, response=response)
60
+ finally:
61
+ # Ensure the response is closed even if the consumer doesn't read all data
62
+ response.close()
62
63
 
63
64
  def __enter__(self) -> Self:
64
65
  return self
@@ -117,11 +118,12 @@ class AsyncStream(Generic[_T]):
117
118
  process_data = self._client._process_response_data
118
119
  iterator = self._iter_events()
119
120
 
120
- async for sse in iterator:
121
- yield process_data(data=sse.json(), cast_to=cast_to, response=response)
122
-
123
- # As we might not fully consume the response stream, we need to close it explicitly
124
- await response.aclose()
121
+ try:
122
+ async for sse in iterator:
123
+ yield process_data(data=sse.json(), cast_to=cast_to, response=response)
124
+ finally:
125
+ # Ensure the response is closed even if the consumer doesn't read all data
126
+ await response.aclose()
125
127
 
126
128
  async def __aenter__(self) -> Self:
127
129
  return self
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "checkout_intents"
4
- __version__ = "0.3.1" # x-release-please-version
4
+ __version__ = "0.3.2" # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: checkout-intents
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: The official Python library for the Checkout Intents API
5
5
  Project-URL: Homepage, https://github.com/rye-com/checkout-intents-python
6
6
  Project-URL: Repository, https://github.com/rye-com/checkout-intents-python
@@ -9,9 +9,9 @@ checkout_intents/_models.py,sha256=m6hDet9vdfyY7TuzbLCBYhMPoIN6hddOZp9qDZ-zfVU,3
9
9
  checkout_intents/_qs.py,sha256=craIKyvPktJ94cvf9zn8j8ekG9dWJzhWv0ob34lIOv4,4828
10
10
  checkout_intents/_resource.py,sha256=X-eWffEBAgzTZvakLqNUjwgidMKfBFRmCeeOiuko4lg,1154
11
11
  checkout_intents/_response.py,sha256=sLqxWBxzmVqPsdr2x5z6d87h8jb1U-Huvh2YFg-U6nE,28876
12
- checkout_intents/_streaming.py,sha256=XOY20ljJEmOSf-nT8_KvPZipmgllR5sO400ePyMVLIY,10185
12
+ checkout_intents/_streaming.py,sha256=y8SjBVAw2SDdVczQsP1T3dufnx4040C5fQqz-jGSvmg,10257
13
13
  checkout_intents/_types.py,sha256=4l2pVH65co-2pua9stzq-WV2VcGg9Hl4nRHd0lz5cko,7246
14
- checkout_intents/_version.py,sha256=GGGuPk3OpdTlt_j2eo1Fr3Aqy8nvF8glUnxNJQWdHEQ,168
14
+ checkout_intents/_version.py,sha256=yTndv8Wif2hvQeYLtvgbHX6MGN5Ho15hPk2Zz6i1EEg,168
15
15
  checkout_intents/pagination.py,sha256=VMe3ftq-qqAku2ERRTOz7iZOoMQ_KKp2HIUl_I8oAXE,2908
16
16
  checkout_intents/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  checkout_intents/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
@@ -46,7 +46,7 @@ checkout_intents/types/payment_method.py,sha256=-v5-L5RPojm8IDrdAhIMGmhVb89vwqT1
46
46
  checkout_intents/types/payment_method_param.py,sha256=_yzwZ5nw7bStK4U2-1ybtpjdJz5funCOMN7MALtF0xk,1225
47
47
  checkout_intents/types/variant_selection.py,sha256=y6mlU-qGwDfE77mU-x1GTXkDsmn6vuPpy5lBYXqXCBw,259
48
48
  checkout_intents/types/variant_selection_param.py,sha256=ahwTmDVIUMV8jvpggEo2jDUTIm9xvXbntDxmIZqT2_k,355
49
- checkout_intents-0.3.1.dist-info/METADATA,sha256=2wIoYlT0XK4ECPzUw9-GFUOl0fdgEAiH0IkUoQaW6l8,23677
50
- checkout_intents-0.3.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
51
- checkout_intents-0.3.1.dist-info/licenses/LICENSE,sha256=dRDmL6lFnLaphTaman8kAc21qY1IQ_qsAETk1F-b6jY,1056
52
- checkout_intents-0.3.1.dist-info/RECORD,,
49
+ checkout_intents-0.3.2.dist-info/METADATA,sha256=zIXtE8BSVtCgbHGDUkiwfH_IpQuqzG2Q2GLpTTeS8kk,23677
50
+ checkout_intents-0.3.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
51
+ checkout_intents-0.3.2.dist-info/licenses/LICENSE,sha256=dRDmL6lFnLaphTaman8kAc21qY1IQ_qsAETk1F-b6jY,1056
52
+ checkout_intents-0.3.2.dist-info/RECORD,,