diff options
author | Adrian Herrmann <adrian.herrmann@qt.io> | 2024-03-06 19:52:00 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-03-07 10:59:43 +0000 |
commit | 79f96174d646423e2b42998e14b6c27bb4120a76 (patch) | |
tree | 6bd426a0f427c2ede2d3b736b359dd5dc8f7b910 | |
parent | c063df86ffdbf95393b5f9ca9aab5d54b128a830 (diff) |
QtAsyncio: Fix missing return value of run()
If QtAsyncio.run() executes asyncio.run(), then its return value should
be passed on.
Task-number: PYSIDE-769
Change-Id: Ic36e3bfd0f15b0697e310af3d9eb4ff6998ffce0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 0b43807deee7ebfe0d5a2fd79e07a6cbab569970)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | sources/pyside6/PySide6/QtAsyncio/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/pyside6/PySide6/QtAsyncio/__init__.py b/sources/pyside6/PySide6/QtAsyncio/__init__.py index 3830ad887..bb5cde9dd 100644 --- a/sources/pyside6/PySide6/QtAsyncio/__init__.py +++ b/sources/pyside6/PySide6/QtAsyncio/__init__.py @@ -20,7 +20,7 @@ __all__ = [ def run(coro: typing.Optional[typing.Coroutine] = None, keep_running: bool = True, quit_qapp: bool = True, *, - debug: typing.Optional[bool] = None) -> None: + debug: typing.Optional[bool] = None) -> typing.Any: """Run the QtAsyncio event loop.""" # Event loop policies are expected to be deprecated with Python 3.13, with @@ -40,7 +40,7 @@ def run(coro: typing.Optional[typing.Coroutine] = None, asyncio.get_event_loop().run_forever() else: if coro: - asyncio.run(coro, debug=debug) + return asyncio.run(coro, debug=debug) else: raise RuntimeError( "QtAsyncio was set to keep running after the coroutine " |