gh-102828: set stacklevel on deprecation warning (#103422)

This commit is contained in:
Irit Katriel 2023-04-11 09:31:39 +01:00 committed by GitHub
parent 4cd1cc843a
commit 8026cda10c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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