[3.12] gh-112645: remove deprecation warning for use of onerror in shutil.rmtree (#112659) (#112665)

gh-112645: remove deprecation warning for use of onerror in shutil.rmtree (#112659)

(cherry picked from commit 97857ac058)
This commit is contained in:
Irit Katriel 2023-12-03 16:28:57 +00:00 committed by GitHub
parent b3b2706cad
commit f5965c2385
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 18 deletions

View file

@ -722,10 +722,6 @@ def rmtree(path, ignore_errors=False, onerror=None, *, onexc=None, dir_fd=None):
If both onerror and onexc are set, onerror is ignored and onexc is used.
"""
if onerror is not None:
warnings.warn("onerror argument is deprecated, use onexc instead",
DeprecationWarning, stacklevel=2)
sys.audit("shutil.rmtree", path, dir_fd)
if ignore_errors:
def onexc(*args):