diff options
-rw-r--r-- | sources/pyside6/PySide6/QtAsyncio/events.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sources/pyside6/PySide6/QtAsyncio/events.py b/sources/pyside6/PySide6/QtAsyncio/events.py index 86b89014a..dd70a32cd 100644 --- a/sources/pyside6/PySide6/QtAsyncio/events.py +++ b/sources/pyside6/PySide6/QtAsyncio/events.py @@ -63,7 +63,10 @@ class QAsyncioExecutorWrapper(QObject): self._loop = QEventLoop() asyncio.events._set_running_loop(self._loop) - QTimer.singleShot(0, self._loop, lambda: self._cb()) + # The do() function will always be executed from the new executor + # thread and never from outside, so using the overload without the + # context argument is sufficient. + QTimer.singleShot(0, lambda: self._cb()) self._loop.exec() if self._exception is not None: |