diff --git a/ner/utils.py b/ner/utils.py index 1d72d2c..3216b26 100644 --- a/ner/utils.py +++ b/ner/utils.py @@ -20,12 +20,11 @@ def tcpip4_socket(host, port): finally: try: s.shutdown(socket.SHUT_RDWR) + s.close() except socket.error: pass except OSError: pass - finally: - s.close() @contextmanager def http_connection(host, port):