per-file-ignores =
# Autogenerated section
psycopg/psycopg/errors.py: E125, E128, E302
+
+ # Allow concatenated string literals from async_to_sync
+ psycopg_pool/psycopg_pool/pool.py: E501
[flake8]
max-line-length = 88
ignore = W503, E203, E704
+
+per-file-ignores =
+ # Allow concatenated string literals from async_to_sync
+ psycopg_pool/pool.py: E501
self._open_implicit = False
warnings.warn(
- f"the default for the {type(self).__name__} 'open' parameter"
- + " will become 'False' in a future release. Please use"
- + " open={True|False} explicitly, or use the pool as context"
- + f" manager using: `with {type(self).__name__}(...) as pool: ...`",
+ f"the default for the {type(self).__name__} 'open' parameter will become 'False' in a future release. Please use open={{True|False}} explicitly, or use the pool as context manager using: `with {type(self).__name__}(...) as pool: ...`",
DeprecationWarning,
)
elif self.max_waiting and len(self._waiting) >= self.max_waiting:
self._stats[self._REQUESTS_ERRORS] += 1
raise TooManyRequests(
- f"the pool {self.name!r} has already"
- + f" {len(self._waiting)} requests waiting"
+ f"the pool {self.name!r} has already {len(self._waiting)} requests waiting"
)
return conn
if status != TransactionStatus.IDLE:
sname = TransactionStatus(status).name
raise e.ProgrammingError(
- f"connection left in status {sname} by configure function"
- + f" {self._configure}: discarded"
+ f"connection left in status {sname} by configure function {self._configure}: discarded"
)
# Set an expiry date, with some randomness to avoid mass reconnection
if status != TransactionStatus.IDLE:
sname = TransactionStatus(status).name
raise e.ProgrammingError(
- f"connection left in status {sname} by reset function"
- + f" {self._reset}: discarded"
+ f"connection left in status {sname} by reset function {self._reset}: discarded"
)
except Exception as ex:
logger.warning(f"error resetting connection: {ex}")
if to_close:
logger.info(
- "shrinking pool %r to %s because %s unused connections"
- + " in the last %s sec",
+ "shrinking pool %r to %s because %s unused connections in the last %s sec",
self.name,
self._nconns,
nconns_min,
else:
warnings.warn(
f"the default for the {type(self).__name__} 'open' parameter"
- + " will become 'False' in a future release. Please use"
- + " open={True|False} explicitly, or use the pool as context"
- + f" manager using: `with {type(self).__name__}(...) as pool: ...`",
+ " will become 'False' in a future release. Please use"
+ " open={True|False} explicitly, or use the pool as context"
+ f" manager using: `with {type(self).__name__}(...) as pool: ...`",
DeprecationWarning,
)
self._stats[self._REQUESTS_ERRORS] += 1
raise TooManyRequests(
f"the pool {self.name!r} has already"
- + f" {len(self._waiting)} requests waiting"
+ f" {len(self._waiting)} requests waiting"
)
return conn
sname = TransactionStatus(status).name
raise e.ProgrammingError(
f"connection left in status {sname} by configure function"
- + f" {self._configure}: discarded"
+ f" {self._configure}: discarded"
)
# Set an expiry date, with some randomness to avoid mass reconnection
sname = TransactionStatus(status).name
raise e.ProgrammingError(
f"connection left in status {sname} by reset function"
- + f" {self._reset}: discarded"
+ f" {self._reset}: discarded"
)
except Exception as ex:
logger.warning(f"error resetting connection: {ex}")
if to_close:
logger.info(
"shrinking pool %r to %s because %s unused connections"
- + " in the last %s sec",
+ " in the last %s sec",
self.name,
self._nconns,
nconns_min,