From 4ba03f57e0de2aaf903a2bd8db7864af0503312c Mon Sep 17 00:00:00 2001 From: Rouven Bauer Date: Wed, 7 Apr 2021 17:17:38 +0200 Subject: [PATCH] Don't handle raw socket after it's wrapped in connection --- neo4j/io/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/neo4j/io/__init__.py b/neo4j/io/__init__.py index 5d323d45..f71c2485 100644 --- a/neo4j/io/__init__.py +++ b/neo4j/io/__init__.py @@ -85,6 +85,7 @@ ) from neo4j.routing import RoutingTable + # Set up logger log = getLogger("neo4j") @@ -247,9 +248,8 @@ def open(cls, address, *, auth=None, timeout=None, routing_context=None, **pool_ try: connection.hello() - except Exception as error: - log.debug("[#%04X] C: %s", s.getsockname()[1], str(error)) - _close_socket(s) + except Exception: + connection.close() raise return connection