def METHOD_NAME(tempDir):
    for i in range(3):
        try:
            shutil.rmtree(tempDir)
        except Exception:
            time.sleep(0.2)  # Give OS time to free sources
        else:
            break
    else:
        print("Oops, could not fully clean up temporary files.")