File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -1042,19 +1042,19 @@ async def __aexit__(self, *exc):
1042
1042
1043
1043
class PoolAcquireContext :
1044
1044
1045
- __slots__ = ('timeout' , 'connection ' , 'done' , 'pool' )
1045
+ __slots__ = ('timeout' , '_conn ' , 'done' , 'pool' )
1046
1046
1047
1047
def __init__ (self , pool : Pool , timeout : Optional [float ]) -> None :
1048
1048
self .pool = pool
1049
1049
self .timeout = timeout
1050
- self .connection = None
1050
+ self ._conn = None
1051
1051
self .done = False
1052
1052
1053
- async def __aenter__ (self ):
1054
- if self .connection is not None or self .done :
1053
+ async def __aenter__ (self ) -> connection . Connection :
1054
+ if self ._conn is not None or self .done :
1055
1055
raise exceptions .InterfaceError ('a connection is already acquired' )
1056
- self .connection = await self .pool ._acquire (self .timeout )
1057
- return self .connection
1056
+ self ._conn = await self .pool ._acquire (self .timeout )
1057
+ return self ._conn
1058
1058
1059
1059
async def __aexit__ (
1060
1060
self ,
@@ -1063,8 +1063,8 @@ async def __aexit__(
1063
1063
exc_tb : Optional [TracebackType ] = None ,
1064
1064
) -> None :
1065
1065
self .done = True
1066
- con = self .connection
1067
- self .connection = None
1066
+ con = self ._conn
1067
+ self ._conn = None
1068
1068
await self .pool .release (con )
1069
1069
1070
1070
def __await__ (self ):
You can’t perform that action at this time.
0 commit comments