[CI][ScriptedBuilder] Avoid python 3.12-only option (#181746)

The shutil.rmtree(onexc=) parameter was only added in Python 3.12. Use
onerror= instead whose callback signature takes a different third
parameter which is ignored anyway.
This commit is contained in:
Michael Kruse
2026-02-16 22:51:48 +01:00
committed by GitHub
parent 227d8d33c6
commit 4e8b7bdfea

View File

@@ -148,7 +148,7 @@ def rmtree(path):
Taken from official Python docs
https://docs.python.org/3/library/shutil.html#rmtree-example
"""
shutil.rmtree(path, onexc=_remove_readonly)
shutil.rmtree(path, onerror=_remove_readonly)
def try_delete(path):