]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-102828: set stacklevel on deprecation warning (#103422)
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Tue, 11 Apr 2023 08:31:39 +0000 (09:31 +0100)
committerGitHub <noreply@github.com>
Tue, 11 Apr 2023 08:31:39 +0000 (09:31 +0100)
Lib/shutil.py

index 8b378645a5a37506e8215c62cdf4028e74d2dfbd..95b6c5299cab293df62f900b28c09d8844d076f3 100644 (file)
@@ -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: