summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-04-11 08:31:39 (GMT)
committerGitHub <noreply@github.com>2023-04-11 08:31:39 (GMT)
commit8026cda10ccd3cbc7f7ff84dc6970266512961e4 (patch)
treee19e51e20bcf1f40c4bc07c88b4a840728789019
parent4cd1cc843aa4ae77a543cdd882da687300762e9d (diff)
downloadcpython-8026cda10ccd3cbc7f7ff84dc6970266512961e4.zip
cpython-8026cda10ccd3cbc7f7ff84dc6970266512961e4.tar.gz
cpython-8026cda10ccd3cbc7f7ff84dc6970266512961e4.tar.bz2
gh-102828: set stacklevel on deprecation warning (#103422)
-rw-r--r--Lib/shutil.py2
1 files changed, 1 insertions, 1 deletions
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: