From 5e3432646ad63749ff0d655c157fe293cdc6c2aa Mon Sep 17 00:00:00 2001 From: xmo-odoo Date: Tue, 16 Feb 2021 15:32:52 +0100 Subject: [PATCH] Add proper stacklevel to method_allowlist warning --- src/urllib3/util/retry.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/urllib3/util/retry.py b/src/urllib3/util/retry.py index ee51f922f8..d25a41b42e 100644 --- a/src/urllib3/util/retry.py +++ b/src/urllib3/util/retry.py @@ -253,6 +253,7 @@ def __init__( "Using 'method_whitelist' with Retry is deprecated and " "will be removed in v2.0. Use 'allowed_methods' instead", DeprecationWarning, + stacklevel=2, ) allowed_methods = method_whitelist if allowed_methods is _Default: