From: Jamie Hewland Date: Fri, 22 May 2020 09:31:21 +0000 (+0200) Subject: Fix pool option warnings for default connection pool (#980) X-Git-Tag: 0.13.1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e724abdcd190eca5ac17e7da23fd79db5f10df7c;p=thirdparty%2Fhttpx.git Fix pool option warnings for default connection pool (#980) * warn_deprecated: Set stacklevel=2 to get real source of warning * Use new pool limit options in default pool Co-authored-by: Tom Christie --- diff --git a/httpx/_config.py b/httpx/_config.py index 0dc7a460..3785af98 100644 --- a/httpx/_config.py +++ b/httpx/_config.py @@ -367,5 +367,5 @@ class Proxy: DEFAULT_TIMEOUT_CONFIG = Timeout(timeout=5.0) -DEFAULT_POOL_LIMITS = PoolLimits(soft_limit=10, hard_limit=100) +DEFAULT_POOL_LIMITS = PoolLimits(max_keepalive=10, max_connections=100) DEFAULT_MAX_REDIRECTS = 20 diff --git a/httpx/_utils.py b/httpx/_utils.py index f8faf97a..cf64d89f 100644 --- a/httpx/_utils.py +++ b/httpx/_utils.py @@ -404,4 +404,4 @@ def as_network_error(*exception_classes: type) -> typing.Iterator[None]: def warn_deprecated(message: str) -> None: - warnings.warn(message, DeprecationWarning) + warnings.warn(message, DeprecationWarning, stacklevel=2)