Fix thread exception when stopping server

This commit is contained in:
Cédric Krier committed 2008-09-21 19:03:44 +02:00
1 parent 38f0d5e7a7
commit 05c4ff16be
1 file changed
+3 -2
+3 -2
View File
@@ -334,13 +334,14 @@ class TinySocketServerThread(threading.Thread):
self.secure)
self.threads.append(c_thread)
c_thread.start()
finally:
except:
self.socket.close()
return False
def stop(self):
self.running = False
for thread in self.threads:
while len(self.threads):
thread = self.threads[0]
thread.stop()
try:
if hasattr(socket, 'SHUT_RDWR'):