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') log.warning('Failed to connect to log server')
return return
finally: finally:
try:
sock.shutdown(socket.SHUT_RDWR) sock.shutdown(socket.SHUT_RDWR)
except OSError:
pass
sock.close() sock.close()
queue = Queue() queue = Queue()