python-iterutils 0.0.4__tar.gz → 0.0.4.1__tar.gz
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.
- {python_iterutils-0.0.4 → python_iterutils-0.0.4.1}/PKG-INFO +1 -1
- {python_iterutils-0.0.4 → python_iterutils-0.0.4.1}/iterutils/__init__.py +20 -7
- {python_iterutils-0.0.4 → python_iterutils-0.0.4.1}/pyproject.toml +1 -1
- python_iterutils-0.0.4/iterutils/.DS_Store +0 -0
- {python_iterutils-0.0.4 → python_iterutils-0.0.4.1}/LICENSE +0 -0
- {python_iterutils-0.0.4 → python_iterutils-0.0.4.1}/iterutils/py.typed +0 -0
- {python_iterutils-0.0.4 → python_iterutils-0.0.4.1}/readme.md +0 -0
|
@@ -178,6 +178,7 @@ def run_gen_step(
|
|
|
178
178
|
gen = gen_step
|
|
179
179
|
close = None
|
|
180
180
|
send = gen.send
|
|
181
|
+
throw = gen.throw
|
|
181
182
|
if async_:
|
|
182
183
|
async def process():
|
|
183
184
|
try:
|
|
@@ -186,13 +187,20 @@ def run_gen_step(
|
|
|
186
187
|
else:
|
|
187
188
|
func = send(None)
|
|
188
189
|
while True:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
try:
|
|
191
|
+
ret = func()
|
|
192
|
+
if isawaitable(ret):
|
|
193
|
+
ret = await ret
|
|
194
|
+
except BaseException as e:
|
|
195
|
+
if threaded:
|
|
196
|
+
func = await to_thread(throw, e)
|
|
197
|
+
else:
|
|
198
|
+
func = throw(e)
|
|
194
199
|
else:
|
|
195
|
-
|
|
200
|
+
if threaded:
|
|
201
|
+
func = await to_thread(send, ret)
|
|
202
|
+
else:
|
|
203
|
+
func = send(ret)
|
|
196
204
|
except StopIteration as e:
|
|
197
205
|
return e.value
|
|
198
206
|
finally:
|
|
@@ -206,7 +214,12 @@ def run_gen_step(
|
|
|
206
214
|
try:
|
|
207
215
|
func = send(None)
|
|
208
216
|
while True:
|
|
209
|
-
|
|
217
|
+
try:
|
|
218
|
+
ret = func()
|
|
219
|
+
except BaseException as e:
|
|
220
|
+
func = throw(e)
|
|
221
|
+
else:
|
|
222
|
+
func = send(ret)
|
|
210
223
|
except StopIteration as e:
|
|
211
224
|
return e.value
|
|
212
225
|
finally:
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|