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 <tom@tomchristie.com>
This commit is contained in:
Jamie Hewland 2020-05-22 11:31:21 +02:00 committed by GitHub
parent c30acf09fb
commit e724abdcd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View 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

View 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)