def remove_tree(directory):
    'Recursively remove a directory and its contents.'
    if (not os.path.exists(directory)):
        return
    if (not os.path.isdir(directory)):
        raise error.Error('RemoveTree: not a directory: %s', directory)
    shutil.rmtree(directory)
Recursively remove a directory and its contents.
def remove_tree(directory):
    
    if (not os.path.exists(directory)):
        return
    if (not os.path.isdir(directory)):
        raise error.Error('RemoveTree: not a directory: %s', directory)
    shutil.rmtree(directory)