Handle interrupted system call errors.

This commit is contained in:
Aldo Cortesi 2013-08-25 10:22:09 +12:00
parent 62edceee09
commit 7428f95474
1 changed files with 7 additions and 1 deletions

View File

@ -376,7 +376,13 @@ class TCPServer:
self.__is_shut_down.clear()
try:
while not self.__shutdown_request:
r, w, e = select.select([self.socket], [], [], poll_interval)
try:
r, w, e = select.select([self.socket], [], [], poll_interval)
except select.error, ex:
if ex[0] == 4:
continue
else:
raise
if self.socket in r:
request, client_address = self.socket.accept()
t = threading.Thread(