We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6158742 commit b166c29Copy full SHA for b166c29
pydantic_ai_slim/pydantic_ai/_utils.py
@@ -239,6 +239,10 @@ def sync_async_iterator(async_iter: AsyncIterator[T]) -> Iterator[T]:
239
while True:
240
try:
241
yield loop.run_until_complete(anext(async_iter))
242
+ except RuntimeError as e:
243
+ if str(e) == 'Attempted to exit cancel scope in a different task than it was entered in':
244
+ break
245
+ raise
246
except StopAsyncIteration:
247
break
248
0 commit comments