Skip to content

Commit 5d1ca12

Browse files
committed
Fix mypy error my creating a Task
Although Python doesn't support canceling coroutines in a different thread, it allows gathering the result. QMemMan also doesn't allow canceling API calls, so the cancel is a no-op.
1 parent 12ac510 commit 5d1ca12

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

qubes/vm/dispvm.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,11 @@ async def on_domain_pre_paused(self, event, **kwargs) -> None:
626626
return
627627
break_task = asyncio.create_task(self.preload_requested_event.wait())
628628
qmemman_client = qubes.qmemman.client.QMemmanClient()
629-
qmemman_task = asyncio.to_thread(
630-
qmemman_client.set_mem,
631-
{self.xid: 0},
629+
qmemman_task = asyncio.create_task(
630+
asyncio.to_thread(
631+
qmemman_client.set_mem,
632+
{self.xid: 0},
633+
)
632634
)
633635
tasks: list = [break_task, qmemman_task]
634636
result = None

0 commit comments

Comments
 (0)