def METHOD_NAME(path, onerror=None):
    """Remove all subdirectories in this path.
    The directory indicated by `path` is left in place, and its subdirectories
    are erased.
    If onerror is set, it is called to handle the error with arguments (func,
    path, exc_info) where func is os.listdir, os.remove, or os.rmdir;
    path is the argument to that function that caused it to fail; and
    exc_info is a tuple returned by sys.exc_info().  If onerror is None,
    an exception is raised.
    """
    # NOTE this code is adapted from the one in shutil.rmtree, and is
    # just as fast
    names = []
    try:
        names = os.listdir(path)
    except os.error:
        if onerror is not None:
            onerror(os.listdir, path, sys.exc_info())
        else:
            raise
    for name in names:
        fullname = os.path.join(path, name)
        delete_folder(fullname, onerror=onerror)