Async qt: Python
-
I have my asynchronous function inside
@asyncSlot()
:msg = QMessageBox() if not self.id_edit.text(): msg.setText('Specificy an id') msg.exec_() return final_object = await self.filter_id() if final_object: return await final_object.send(self.message_edit.text() if self.message_edit.text() else 'Hello') msg.setText('Invalid id') msg.exec_()
It works completely fine, but I am receieving an error from the final
msg.setText('Invalid id') msg.exec_()
It shows up, but gives this error twice:
Traceback (most recent call last): File "C:\Users\caede\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, *self._args) RuntimeError: Cannot enter into task <Task pending name='Task-9' coro=<ConnectionState._delay_ready() running at C:\Users\caede\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\state.py:415> wait_for=<Future finished result=None>> while another task <Task pending name='Task-70' coro=<MainWindow.trigger_message() running at c:\Users\caede\Desktop\Github\integrated-bot-gui\bot-gui\src\Mainwindow.py:174> cb=[asyncSlot.<locals>._error_handler() at C:\Users\caede\AppData\Local\Programs\Python\Python39\lib\site-packages\qasync\__init__.py:775]> is being executed.
does this have anything to do with the fact im using
asyncQt
? -
@eyllanesc Sorry I don't quite understand. The full code is on my github;
https://github.com/Caedenph/integrated-bot-gui
I thought i posted what was needed, what else would you like?I'm trying to reply as fast as I can but unfortunately I dont have a rep so it takes 10 minutes
-
@Caeden I need an example that I can copy, paste and run that will allow me to reproduce the problem. I am not going to review a GH project since it is a lot of code that implies a lot of time that I do not want to invest. If you want help then provide what I have asked, otherwise I will go my way. Bye Bye
-
@eyllanesc I am sorry for my misunderstanding: i'm not sure how to give a reproducible example seeing as I am using asyncqt, and nothing isnt working it was just raising a weird error. I might try and figure out another way other than
QMessageBox
. I was just seeing if anyone here had a similiar problem. Thanks though :) -
Hi,
Did you try to follow the pattern of the qasync project example ?