diff options
| author | Adrian Herrmann <adrian.herrmann@qt.io> | 2023-12-23 18:09:24 +0100 |
|---|---|---|
| committer | Adrian Herrmann <adrian.herrmann@qt.io> | 2024-01-07 19:34:56 +0100 |
| commit | 8c9ad6eacc66065130b226ba486749d0eae48226 (patch) | |
| tree | d1a62c6e2e3f6fa20bd26621586a9580969de777 /sources/pyside6/PySide6/QtAsyncio/tasks.py | |
| parent | b91596118fda9b586f19adcb1feee1db40abeb86 (diff) | |
QtAsyncio: Make tasks awaitable
Tasks are supposed to be awaitable objects. Fix a leftover from an old
misunderstanding of tasks vs futures very early in the development
process.
Pick-to: 6.6
Fixes: PYSIDE-2561
Task-number: PYSIDE-769
Change-Id: I916d6e235c5e67ea0d03f1df3b1bf8dfd8cb9c83
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/PySide6/QtAsyncio/tasks.py')
| -rw-r--r-- | sources/pyside6/PySide6/QtAsyncio/tasks.py | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/sources/pyside6/PySide6/QtAsyncio/tasks.py b/sources/pyside6/PySide6/QtAsyncio/tasks.py index 4f214c65a..bc3d41a73 100644 --- a/sources/pyside6/PySide6/QtAsyncio/tasks.py +++ b/sources/pyside6/PySide6/QtAsyncio/tasks.py @@ -47,14 +47,6 @@ class QAsyncioTask(futures.QAsyncioFuture): class QtTaskApiMisuseError(Exception): pass - def __await__(self) -> None: # type: ignore[override] - # This function is not inherited from the Future APIs. - raise QAsyncioTask.QtTaskApiMisuseError("Tasks cannot be awaited") - - def __iter__(self) -> None: # type: ignore[override] - # This function is not inherited from the Future APIs. - raise QAsyncioTask.QtTaskApiMisuseError("Tasks cannot be iterated over") - def set_result(self, result: typing.Any) -> None: # type: ignore[override] # This function is not inherited from the Future APIs. raise QAsyncioTask.QtTaskApiMisuseError("Tasks cannot set results") |
