def METHOD_NAME(path, attempts=5):
    import shutil
    try:
        shutil.rmtree(path)
    except OSError as e:
        # Directory not empty due to slow filesystem (see #1326 old occurance).
        if attempts <= 0 or e.errno != 39:
            raise e
        from time import sleep
        sleep(0.25)
        METHOD_NAME(path, attempts - 1)