You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have been using quamash with pyqt5 for 2 years, it works great(thanks alot to you).
But recently my envirioment updated, I got error when calling asyncio.sleep(0.1) in pyqt views bisiness.
My environment:
linux system with kernel 4.19
python3.8
Quamash ==0.6.1
Here is some test code could raise the same error as my business:
import sys
import asyncio
import quamash
from PyQt5 import QtWidgets
async def loop_func():
for i in range(1000):
print('hello')
await asyncio.sleep(0.1)
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
loop = quamash.QEventLoop(app)
asyncio.set_event_loop(loop)
with loop:
asyncio.ensure_future(loop_func(), loop=loop)
loop.run_forever()
Output:
Task exception was never retrieved
future: <Task finished name='Task-1' coro=<loop_func() done, defined at /home/wood/project/data-manage-client/test.py:7> exception=RuntimeError('no running event loop')>
Traceback (most recent call last):
File "/home/wood/project/data-manage-client/test.py", line 10, in loop_func
await asyncio.sleep(0.1)
File "/usr/lib64/python3.8/asyncio/tasks.py", line 637, in sleep
loop = events.get_running_loop()
RuntimeError: no running event loop
Hello, I have been using quamash with pyqt5 for 2 years, it works great(thanks alot to you).
But recently my envirioment updated, I got error when calling
asyncio.sleep(0.1)
in pyqt views bisiness.My environment:
Here is some test code could raise the same error as my business:
Output:
I have search the same error:
https://github.com/gmarull/asyncqt/issues/12
gmarull/asyncqt#13
Refer to that, I solve it with:
The text was updated successfully, but these errors were encountered: