pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/MagicStack/asyncpg/pull/1270/files

t" href="https://github.githubassets.com/assets/github-cf976967feea1e66.css" /> Add return type to PoolAcquireContext.__aenter__ and rename attribute by TerSent · Pull Request #1270 · MagicStack/asyncpg · GitHub
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions asyncpg/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,19 +1042,19 @@ async def __aexit__(self, *exc):

class PoolAcquireContext:

__slots__ = ('timeout', 'connection', 'done', 'pool')
__slots__ = ('timeout', '_conn', 'done', 'pool')

def __init__(self, pool: Pool, timeout: Optional[float]) -> None:
self.pool = pool
self.timeout = timeout
self.connection = None
self._conn = None
self.done = False

async def __aenter__(self):
if self.connection is not None or self.done:
async def __aenter__(self) -> connection.Connection:
if self._conn is not None or self.done:
raise exceptions.InterfaceError('a connection is already acquired')
self.connection = await self.pool._acquire(self.timeout)
return self.connection
self._conn = await self.pool._acquire(self.timeout)
return self._conn

async def __aexit__(
self,
Expand All @@ -1063,8 +1063,8 @@ async def __aexit__(
exc_tb: Optional[TracebackType] = None,
) -> None:
self.done = True
con = self.connection
self.connection = None
con = self._conn
self._conn = None
await self.pool.release(con)

def __await__(self):
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy