aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtAsyncio/tasks.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6/PySide6/QtAsyncio/tasks.py')
-rw-r--r--sources/pyside6/PySide6/QtAsyncio/tasks.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/QtAsyncio/tasks.py b/sources/pyside6/PySide6/QtAsyncio/tasks.py
index 05ee17dd6..bc84571b6 100644
--- a/sources/pyside6/PySide6/QtAsyncio/tasks.py
+++ b/sources/pyside6/PySide6/QtAsyncio/tasks.py
@@ -64,6 +64,9 @@ class QAsyncioTask(futures.QAsyncioFuture):
if self.done():
return
result = None
+
+ asyncio._enter_task(self._loop, self) # type: ignore[arg-type]
+
try:
if exception_or_future is None:
result = self._coro.send(None)
@@ -104,6 +107,8 @@ class QAsyncioTask(futures.QAsyncioFuture):
self._schedule_callbacks()
self._loop.stop()
+ asyncio._leave_task(self._loop, self) # type: ignore[arg-type]
+
def get_stack(self, *, limit=None) -> typing.List[typing.Any]:
# TODO
raise NotImplementedError("QtTask.get_stack is not implemented")