From 5f5d9347b9ec06e0dda34d6bd89714ee25731053 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 26 Jul 2015 15:27:47 -0600 Subject: [PATCH] Makes sure the loop is running when closing the app. --- gns3server/modules/qemu/__init__.py | 1 - gns3server/server.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gns3server/modules/qemu/__init__.py b/gns3server/modules/qemu/__init__.py index 6b95d989..826bfbe5 100644 --- a/gns3server/modules/qemu/__init__.py +++ b/gns3server/modules/qemu/__init__.py @@ -46,7 +46,6 @@ class Qemu(BaseManager): :returns: List of folders where Qemu binaries MAY reside. """ - qemus = [] paths = set() try: paths.add(os.getcwd()) diff --git a/gns3server/server.py b/gns3server/server.py index 97925fdb..0c81b5a3 100644 --- a/gns3server/server.py +++ b/gns3server/server.py @@ -252,7 +252,8 @@ class Server: # TypeError: async() takes 1 positional argument but 3 were given log.warning("TypeError exception in the loop {}".format(e)) finally: - if self._handler: + if self._handler and self._loop.is_running(): self._loop.run_until_complete(self._handler.finish_connections()) server.close() - self._loop.run_until_complete(app.finish()) + if self._loop.is_running(): + self._loop.run_until_complete(app.finish())