def delete_directory(path):
 shutil.rmtree(path, onerror=_on_error)
 return (not os.path.exists(path))

def delete_directory ( path ) : shutil . rmtree ( path , onerror = _on_error ) return ( not os . path . exists ( path ) )
tries to delete a folder .