@@ -277,18 +277,19 @@ def get_handshake(cls):
277277 return b"" .join (version .to_bytes () for version in offered_versions ).ljust (16 , b"\x00 " )
278278
279279 @classmethod
280- def ping (cls , address , * , timeout = None , ** config ):
280+ def ping (cls , address , * , timeout = None , pool_config = None ):
281281 """ Attempt to establish a Bolt connection, returning the
282282 agreed Bolt protocol version if successful.
283283 """
284- config = PoolConfig .consume (config )
284+ if pool_config is None :
285+ pool_config = PoolConfig ()
285286 try :
286287 s , protocol_version , handshake , data = BoltSocket .connect (
287288 address ,
288289 timeout = timeout ,
289- custom_resolver = config .resolver ,
290- ssl_context = config .get_ssl_context (),
291- keep_alive = config .keep_alive ,
290+ custom_resolver = pool_config .resolver ,
291+ ssl_context = pool_config .get_ssl_context (),
292+ keep_alive = pool_config .keep_alive ,
292293 )
293294 except (ServiceUnavailable , SessionExpired , BoltHandshakeError ):
294295 return None
@@ -297,7 +298,8 @@ def ping(cls, address, *, timeout=None, **config):
297298 return protocol_version
298299
299300 @classmethod
300- def open (cls , address , * , auth = None , timeout = None , routing_context = None , ** pool_config ):
301+ def open (cls , address , * , auth = None , timeout = None , routing_context = None ,
302+ pool_config = None ):
301303 """ Open a new Bolt connection to a given server address.
302304
303305 :param address:
@@ -316,7 +318,8 @@ def time_remaining():
316318 return t if t > 0 else 0
317319
318320 t0 = perf_counter ()
319- pool_config = PoolConfig .consume (pool_config )
321+ if pool_config is None :
322+ pool_config = PoolConfig ()
320323
321324 socket_connection_timeout = pool_config .connection_timeout
322325 if socket_connection_timeout is None :
@@ -906,7 +909,7 @@ def open(cls, address, *, auth, pool_config, workspace_config):
906909 def opener (addr , timeout ):
907910 return Bolt .open (
908911 addr , auth = auth , timeout = timeout , routing_context = None ,
909- ** pool_config
912+ pool_config = pool_config
910913 )
911914
912915 pool = cls (opener , pool_config , workspace_config , address )
@@ -951,7 +954,8 @@ def open(cls, *addresses, auth, pool_config, workspace_config, routing_context=N
951954
952955 def opener (addr , timeout ):
953956 return Bolt .open (addr , auth = auth , timeout = timeout ,
954- routing_context = routing_context , ** pool_config )
957+ routing_context = routing_context ,
958+ pool_config = pool_config )
955959
956960 pool = cls (opener , pool_config , workspace_config , address )
957961 return pool
0 commit comments