]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Fix pool option warnings for default connection pool (#980)
authorJamie Hewland <jamie.hewland@hpe.com>
Fri, 22 May 2020 09:31:21 +0000 (11:31 +0200)
committerGitHub <noreply@github.com>
Fri, 22 May 2020 09:31:21 +0000 (10:31 +0100)
* warn_deprecated: Set stacklevel=2 to get real source of warning

* Use new pool limit options in default pool

Co-authored-by: Tom Christie <tom@tomchristie.com>
httpx/_config.py
httpx/_utils.py

index 0dc7a460dbe6d8d85a9664822c108397eed09581..3785af9806d532340a9a39576d175296f6d5714c 100644 (file)
@@ -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
index f8faf97af45531c9960b9887f2d012794ad7c14b..cf64d89fccda3ece5ea801385c580a40e651dc40 100644 (file)
@@ -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)