Skip to content

Commit

Permalink
Fix MyPy failure with partial creation
Browse files Browse the repository at this point in the history
  • Loading branch information
aiudirog committed Aug 8, 2024
1 parent 470e3df commit 2052777
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aiuti/asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ def _queue_elements() -> None:

q: 'aio.Queue[Union[T, object]]' = aio.Queue()
loop = aio.get_running_loop()
put = partial(loop.call_soon_threadsafe, q.put_nowait)
put = partial(
loop.call_soon_threadsafe,
q.put_nowait, # type: ignore[arg-type]
# ^ Type stubs don't understand partial will pass args later
)
with ThreadPoolExecutor(1) as pool:
future = loop.run_in_executor(pool, _queue_elements)
while (i := await q.get()) is not _DONE:
Expand Down

0 comments on commit 2052777

Please sign in to comment.