def safe_rmtree ( directory ) : if os . path . exists ( directory ) : shutil . rmtree ( directory , True )
delete a directory in python
Delete a directory if it s present . If it s not present no - op .
def safe_rmtree(directory):
  """Delete a directory if it's present. If it's not present, no-op."""
  if os.path.exists(directory):
    shutil.rmtree(directory, True)