You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
330 B
12 lines
330 B
import sys |
|
import shutil |
|
|
|
|
|
def shutil_rmtree(path, ignore_errors=False, onexc=None): |
|
if sys.version_info >= (3, 12): |
|
return shutil.rmtree(path, ignore_errors, onexc=onexc) |
|
|
|
def _handler(fn, path, excinfo): |
|
return onexc(fn, path, excinfo[1]) |
|
|
|
return shutil.rmtree(path, ignore_errors, onerror=_handler)
|
|
|