@@ -281,19 +281,19 @@ def factory() -> ClientConnection:
281
281
282
282
loop = asyncio .get_running_loop ()
283
283
if kwargs .pop ("unix" , False ):
284
- self ._create_connection = loop .create_unix_connection (factory , ** kwargs )
284
+ self .create_connection = loop .create_unix_connection (factory , ** kwargs )
285
285
else :
286
286
if kwargs .get ("sock" ) is None :
287
287
kwargs .setdefault ("host" , wsuri .host )
288
288
kwargs .setdefault ("port" , wsuri .port )
289
- self ._create_connection = loop .create_connection (factory , ** kwargs )
289
+ self .create_connection = loop .create_connection (factory , ** kwargs )
290
290
291
- self ._handshake_args = (
291
+ self .handshake_args = (
292
292
additional_headers ,
293
293
user_agent_header ,
294
294
)
295
295
296
- self ._open_timeout = open_timeout
296
+ self .open_timeout = open_timeout
297
297
298
298
# ... = await connect(...)
299
299
@@ -303,10 +303,10 @@ def __await__(self) -> Generator[Any, None, ClientConnection]:
303
303
304
304
async def __await_impl__ (self ) -> ClientConnection :
305
305
try :
306
- async with asyncio_timeout (self ._open_timeout ):
307
- _transport , self .connection = await self ._create_connection
306
+ async with asyncio_timeout (self .open_timeout ):
307
+ _transport , self .connection = await self .create_connection
308
308
try :
309
- await self .connection .handshake (* self ._handshake_args )
309
+ await self .connection .handshake (* self .handshake_args )
310
310
except (Exception , asyncio .CancelledError ):
311
311
self .connection .transport .close ()
312
312
raise
0 commit comments