updating to 1.7.41

This commit is contained in:
Ayush Saini 2025-05-26 01:11:57 +05:30
parent 2d322e2193
commit 38797c6bc5
179 changed files with 23534 additions and 49926 deletions

View file

@ -23,9 +23,7 @@ class HTTPWarning(Warning):
"""Base warning used by this module."""
_TYPE_REDUCE_RESULT = typing.Tuple[
typing.Callable[..., object], typing.Tuple[object, ...]
]
_TYPE_REDUCE_RESULT = tuple[typing.Callable[..., object], tuple[object, ...]]
class PoolError(HTTPError):
@ -143,6 +141,10 @@ class NewConnectionError(ConnectTimeoutError, HTTPError):
self.conn = conn
super().__init__(f"{conn}: {message}")
def __reduce__(self) -> _TYPE_REDUCE_RESULT:
# For pickling purposes.
return self.__class__, (None, None)
@property
def pool(self) -> HTTPConnection:
warnings.warn(
@ -162,6 +164,10 @@ class NameResolutionError(NewConnectionError):
message = f"Failed to resolve '{host}' ({reason})"
super().__init__(conn, message)
def __reduce__(self) -> _TYPE_REDUCE_RESULT:
# For pickling purposes.
return self.__class__, (None, None, None)
class EmptyPoolError(PoolError):
"""Raised when a pool runs out of connections and no more are allowed."""