8000 gh-102828: set stacklevel on deprecation warning (#103422) · python/cpython@8026cda · GitHub
[go: up one dir, main page]

Skip to content

Commit 8026cda

Browse files
authored
gh-102828: set stacklevel on deprecation warning (#103422)
1 parent 4cd1cc8 commit 8026cda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/shutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ def rmtree(path, ignore_errors=False, onerror=None, *, onexc=None, dir_fd=None):
699699

700700
if onerror is not None:
701701
warnings.warn("onerror argument is deprecated, use onexc instead",
702-
DeprecationWarning)
702+
DeprecationWarning, stacklevel=2)
703703

704704
sys.audit("shutil.rmtree", path, dir_fd)
705705
if ignore_errors:

0 commit comments

Comments
 (0)
0