From 8026cda10ccd3cbc7f7ff84dc6970266512961e4 Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Tue, 11 Apr 2023 09:31:39 +0100 Subject: gh-102828: set stacklevel on deprecation warning (#103422) --- Lib/shutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/shutil.py b/Lib/shutil.py index 8b37864..95b6c52 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -699,7 +699,7 @@ def rmtree(path, ignore_errors=False, onerror=None, *, onexc=None, dir_fd=None): if onerror is not None: warnings.warn("onerror argument is deprecated, use onexc instead", - DeprecationWarning) + DeprecationWarning, stacklevel=2) sys.audit("shutil.rmtree", path, dir_fd) if ignore_errors: -- cgit v0.12