diff options
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: |