Browse Source

fixed OSError from misidentified 'socket' connection

epsylon 2 years ago
parent
commit
7b05f37f57
1 changed files with 5 additions and 2 deletions
  1. 5 2
      core/tokenhub.py

+ 5 - 2
core/tokenhub.py

@@ -61,8 +61,11 @@ class HubThread(Thread):
         self._clients.remove(_thread)
     def shutdown(self):
         if self.ready:
-            self.socket.shutdown(socket.SHUT_RDWR)
-            self.socket.close()
+            try:
+                self.socket.shutdown(socket.SHUT_RDWR)
+                self.socket.close()
+            except OSError:
+                pass
         self.running = False
         self._armed = False
         self.ready = False