Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
winrt/client: add FutureLike wrapper for IAsyncOperation
The fix from #1101 causes the following when run with `python3.10 -X dev`. ERROR:asyncio:Exception in callback Future.set_result(<Future cance...events.py:429>, <_bleak_winrt...001C33C60B100>) handle: <Handle Future.set_result(<Future cance...events.py:429>, <_bleak_winrt...001C33C60B100>)> Traceback (most recent call last): File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, *self._args) asyncio.exceptions.InvalidStateError: invalid state ERROR:asyncio:Exception in callback Future.set_result(<Future cance...events.py:429>, <_bleak_winrt...001C33C60BFC0>) handle: <Handle Future.set_result(<Future cance...events.py:429>, <_bleak_winrt...001C33C60BFC0>)> Traceback (most recent call last): File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, *self._args) asyncio.exceptions.InvalidStateError: invalid state This adds a new FutureLike wrapper to make the IAsyncOperation object look like an asyncio.Future instead of wrapping it in a task.
- Loading branch information