From 500b7112f50780a87fdfc11607e11d590417884a Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 12 Mar 2015 18:50:38 -0600 Subject: [PATCH] Assert host and port are not None when creating the Server instance. --- gns3server/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gns3server/server.py b/gns3server/server.py index ac84cdd7..d1f51471 100644 --- a/gns3server/server.py +++ b/gns3server/server.py @@ -61,6 +61,8 @@ class Server: """ if not hasattr(Server, "_instance") or Server._instance is None: + assert host is not None + assert port is not None Server._instance = Server(host, port) return Server._instance @@ -225,6 +227,6 @@ class Server: self._loop.run_forever() except TypeError as e: # This is to ignore an asyncio.windows_events exception - # on Windows when the process get the SIGBREAK signal + # on Windows when the process gets the SIGBREAK signal # TypeError: async() takes 1 positional argument but 3 were given log.warning("TypeError exception in the loop {}".format(e))