File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -295,19 +295,6 @@ def factory() -> ClientConnection:
295295
296296 self ._open_timeout = open_timeout
297297
298- # async with connect(...) as ...: ...
299-
300- async def __aenter__ (self ) -> ClientConnection :
301- return await self
302-
303- async def __aexit__ (
304- self ,
305- exc_type : type [BaseException ] | None ,
306- exc_value : BaseException | None ,
307- traceback : TracebackType | None ,
308- ) -> None :
309- await self .connection .close ()
310-
311298 # ... = await connect(...)
312299
313300 def __await__ (self ) -> Generator [Any , None , ClientConnection ]:
@@ -333,6 +320,19 @@ async def __await_impl__(self) -> ClientConnection:
333320
334321 __iter__ = __await__
335322
323+ # async with connect(...) as ...: ...
324+
325+ async def __aenter__ (self ) -> ClientConnection :
326+ return await self
327+
328+ async def __aexit__ (
329+ self ,
330+ exc_type : type [BaseException ] | None ,
331+ exc_value : BaseException | None ,
332+ traceback : TracebackType | None ,
333+ ) -> None :
334+ await self .connection .close ()
335+
336336
337337def unix_connect (
338338 path : str | None = None ,
You can’t perform that action at this time.
0 commit comments