diff options
| author | Adrian Herrmann <adrian.herrmann@qt.io> | 2023-11-24 16:35:53 +0100 |
|---|---|---|
| committer | Adrian Herrmann <adrian.herrmann@qt.io> | 2023-11-24 21:23:33 +0100 |
| commit | 476dea383d64d528263ff12d795901b10bc7ed48 (patch) | |
| tree | b2ffe8ad1906bf0f48e6b9fe260c52a5a0a6fbd5 /sources/pyside6/PySide6/QtAsyncio/futures.py | |
| parent | 3078f67ec5f88a3a96d223798abe872eda8c5dbe (diff) | |
QtAsyncio: Do not raise exception at handle cancel
Do not raise an exception when cancelling a handle. The exception should
be raised later, when retrieving the future's result.
Pick-to: 6.6
Task-number: PYSIDE-769
Change-Id: I8243cf16e8be5afe167d69313054e97e9aafc75c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6/PySide6/QtAsyncio/futures.py')
| -rw-r--r-- | sources/pyside6/PySide6/QtAsyncio/futures.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sources/pyside6/PySide6/QtAsyncio/futures.py b/sources/pyside6/PySide6/QtAsyncio/futures.py index 580f34db6..7ed8bcb64 100644 --- a/sources/pyside6/PySide6/QtAsyncio/futures.py +++ b/sources/pyside6/PySide6/QtAsyncio/futures.py @@ -61,7 +61,10 @@ class QAsyncioFuture(): if self._state == QAsyncioFuture.FutureState.DONE_WITH_EXCEPTION and self._exception: raise self._exception if self._state == QAsyncioFuture.FutureState.CANCELLED: - raise asyncio.CancelledError + if self._cancel_message: + raise asyncio.CancelledError(self._cancel_message) + else: + raise asyncio.CancelledError raise asyncio.InvalidStateError def set_result(self, result: typing.Any) -> None: |
