From 4a9ebd573dfa03a555edc19cb1920aaa8813c6c2 Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Fri, 2 Dec 2016 15:52:19 +0200 Subject: [PATCH] Do not try to close zeroed socket --- pupy/network/lib/servers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pupy/network/lib/servers.py b/pupy/network/lib/servers.py index 4afb62e1..1c69e50f 100644 --- a/pupy/network/lib/servers.py +++ b/pupy/network/lib/servers.py @@ -260,4 +260,5 @@ class PupyUDPServer(object): def close(self): self.active=False - self.sock.close() + if self.sock: + self.sock.close()