Skip to content

Commit

Permalink
Fix pool option warnings for default connection pool (#980)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Jamie Hewland and tomchristie committed May 22, 2020
1 parent c30acf0 commit e724abd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion httpx/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,5 +367,5 @@ def __repr__(self) -> str:


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
2 changes: 1 addition & 1 deletion httpx/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit e724abd

Please sign in to comment.