Relative Content

Tag Archive for pythonpython-asyncio

in Python how to disable the “Task was destroyed but it is pending!” warning

As I understand it : if an asyncio task is waiting on a future and this future is destroyed by the garbage collector then the task is destroyed too. Which is great because the task would never have completed anyway because the future will never have a result.
This behavior makes total sense, I might have in my program futures that are destroyed and I like that the tasks that could be waiting on them will not cause memory leak by sticking around. How can I get read of the warning message “Task was destroyed but it is pending!” that is printed in the console each time this happens ?