mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-07 03:56:39 +00:00
fix: add type ignore for asyncio.create_task to support Python 3.9 and 3.10
This commit is contained in:
parent
0e0b1f39ca
commit
0a07cde3a2
@ -246,7 +246,8 @@ def shielded(func: Func) -> Func:
|
||||
# For older versions, fallback to original behavior
|
||||
try:
|
||||
# Create a task with the captured context to preserve context variables
|
||||
task = asyncio.create_task(coro, context=ctx)
|
||||
task = asyncio.create_task(coro, context=ctx) # type: ignore[call-arg]
|
||||
# `call-arg` used to not fail 3.9 or 3.10 tests
|
||||
return await asyncio.shield(task)
|
||||
except TypeError:
|
||||
# Python < 3.11 fallback - create task normally then shield
|
||||
|
Loading…
Reference in New Issue
Block a user