Fix None first_query and TcpClient.disconnect()

This commit is contained in:
Lonami Exo
2018-06-11 19:51:01 +02:00
parent f581db294a
commit 64dd957189
2 changed files with 3 additions and 2 deletions

View File

@@ -84,8 +84,9 @@ class TcpClient:
"""Closes the connection."""
if self._socket is not None:
try:
self._socket.shutdown(socket.SHUT_RDWR)
self._socket.close()
except OSError:
pass
finally:
self._socket = None