Lines Matching refs:onerror
598 def _rmtree_unsafe(path, onerror):
603 onerror(os.scandir, path, sys.exc_info())
615 onerror(os.path.islink, fullname, sys.exc_info())
617 _rmtree_unsafe(fullname, onerror)
622 onerror(os.unlink, fullname, sys.exc_info())
626 onerror(os.rmdir, path, sys.exc_info())
629 def _rmtree_safe_fd(topfd, path, onerror):
635 onerror(os.scandir, path, sys.exc_info())
649 onerror(os.lstat, fullname, sys.exc_info())
656 onerror(os.open, fullname, sys.exc_info())
660 _rmtree_safe_fd(dirfd, fullname, onerror)
666 onerror(os.rmdir, fullname, sys.exc_info())
675 onerror(os.path.islink, fullname, sys.exc_info())
683 onerror(os.unlink, fullname, sys.exc_info())
690 def rmtree(path, ignore_errors=False, onerror=None, *, dir_fd=None):
698 If ignore_errors is set, errors are ignored; otherwise, if onerror
703 is false and onerror is None, an exception is raised.
708 def onerror(*args):
710 elif onerror is None:
711 def onerror(*args):
722 onerror(os.lstat, path, sys.exc_info())
728 onerror(os.open, path, sys.exc_info())
732 _rmtree_safe_fd(fd, path, onerror)
738 onerror(os.rmdir, path, sys.exc_info())
744 onerror(os.path.islink, path, sys.exc_info())
756 onerror(os.path.islink, path, sys.exc_info())
757 # can't continue even if onerror hook returns
759 return _rmtree_unsafe(path, onerror)