Catch errors on socket.shutdown.

It throws an exception if the socket wasn't connected.
This commit is contained in:
Dmitry Kuzmenko 2017-05-31 16:56:04 +03:00
parent 2b3276077c
commit fef0e0ea67

View File

@ -47,7 +47,10 @@ def setup_handlers():
log.warning('Failed to connect to log server')
return
finally:
sock.shutdown(socket.SHUT_RDWR)
try:
sock.shutdown(socket.SHUT_RDWR)
except OSError:
pass
sock.close()
queue = Queue()