def rm_rf(path, dry_run=False):
log.info("<STR_LIT>" % path)<EOL>if dry_run:<EOL><INDENT>return<EOL><DEDENT>try:<EOL><INDENT>if os.path.isdir(path) and not os.path.islink(path):<EOL><INDENT>shutil.rmtree(path)<EOL><DEDENT>else:<EOL><INDENT>os.remove(path)<EOL><DEDENT><DEDENT>except OSError:<EOL><INDENT>pass<EOL><DEDENT>
Remove a file or directory tree.

Won't throw an exception, even if the removal fails.