python-iterutils 0.0.2.2__py3-none-any.whl → 0.0.2.3__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.
iterutils/__init__.py CHANGED
@@ -76,10 +76,16 @@ def wrap_iter(
76
76
  callnext = None
77
77
  for e in it:
78
78
  if callprev:
79
- callprev(e)
79
+ try:
80
+ callprev(e)
81
+ except (StopIteration, GeneratorExit):
82
+ break
80
83
  yield e
81
84
  if callnext:
82
- callnext(e)
85
+ try:
86
+ callnext(e)
87
+ except (StopIteration, GeneratorExit):
88
+ break
83
89
 
84
90
 
85
91
  async def wrap_aiter(
@@ -93,10 +99,16 @@ async def wrap_aiter(
93
99
  callnext = ensure_async(callnext) if callable(callnext) else None
94
100
  async for e in ensure_aiter(it, threaded=threaded):
95
101
  if callprev:
96
- await callprev(e)
102
+ try:
103
+ await callprev(e)
104
+ except (StopAsyncIteration, GeneratorExit):
105
+ break
97
106
  yield e
98
107
  if callnext:
99
- await callnext(e)
108
+ try:
109
+ await callnext(e)
110
+ except (StopAsyncIteration, GeneratorExit):
111
+ break
100
112
 
101
113
 
102
114
  def acc_step(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-iterutils
3
- Version: 0.0.2.2
3
+ Version: 0.0.2.3
4
4
  Summary: Python another itertools.
5
5
  Home-page: https://github.com/ChenyangGao/web-mount-packs/tree/main/python-module/python-iterutils
6
6
  License: MIT
@@ -0,0 +1,7 @@
1
+ LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
2
+ iterutils/__init__.py,sha256=ipmyPc_A1QPWhSxaBQwCEtMH9iXEnEz_s9gWwjSOCA0,3505
3
+ iterutils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ python_iterutils-0.0.2.3.dist-info/LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
5
+ python_iterutils-0.0.2.3.dist-info/METADATA,sha256=ueupgxYDzQ_0cvoaGCJSsmDKqFiM2DDWMPNvGtqOAtM,1384
6
+ python_iterutils-0.0.2.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
7
+ python_iterutils-0.0.2.3.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
2
- iterutils/__init__.py,sha256=z5sIhwNu0U7YrxxF2WSxGtZjJu3kU2d6f2LXLwTJqH8,3119
3
- iterutils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- python_iterutils-0.0.2.2.dist-info/LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
5
- python_iterutils-0.0.2.2.dist-info/METADATA,sha256=pl-dTESGVeFhCx4uvb67K8NAtwXR7Fe5vU5tLuRQ5s4,1384
6
- python_iterutils-0.0.2.2.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
7
- python_iterutils-0.0.2.2.dist-info/RECORD,,