MCPcopy Create free account
hub / github.com/conda/constructor / rm_rf

Function rm_rf

constructor/utils.py:250–263  ·  view source on GitHub ↗

try to delete path, but never fail

(path)

Source from the content-addressed store, hash-verified

248
249
250def rm_rf(path):
251 """
252 try to delete path, but never fail
253 """
254 try:
255 if islink(path) or isfile(path):
256 # Note that we have to check if the destination is a link because
257 # exists('/path/to/dead-link') will return False, although
258 # islink('/path/to/dead-link') is True.
259 unlink(path)
260 elif isdir(path):
261 rmtree(path)
262 except OSError:
263 pass
264
265
266def yield_lines(path):

Callers 2

fresh_dirFunction · 0.85
pkgbuild_scriptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected