diff --git a/gns3server/web/web_server.py b/gns3server/web/web_server.py index 4e07fd69..8971f587 100644 --- a/gns3server/web/web_server.py +++ b/gns3server/web/web_server.py @@ -137,7 +137,12 @@ class WebServer: if PortManager.instance().udp_ports: log.warning("UDP ports are still used {}".format(PortManager.instance().udp_ports)) - for task in asyncio.Task.all_tasks(): + try: + tasks = asyncio.all_tasks() + except AttributeError: + tasks = asyncio.Task.all_tasks() + + for task in tasks: task.cancel() try: await asyncio.wait_for(task, 1)