1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 01:40:07 +00:00

*: use utils.remove() some more

(Bitbake rev: d3489b141cac1197324661680fe38b8a88bc49b4)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Bernhard Reutner-Fischer
2011-01-10 23:05:19 +01:00
committed by Richard Purdie
parent c405a3a13e
commit 2ef204dcdd
5 changed files with 13 additions and 23 deletions
+3 -1
View File
@@ -582,10 +582,12 @@ def build_environment(d):
def remove(path, recurse=False):
"""Equivalent to rm -f or rm -rf"""
if not path:
return
import os, errno, shutil
try:
os.unlink(path)
except OSError, exc:
except OSError as exc:
if recurse and exc.errno == errno.EISDIR:
shutil.rmtree(path)
elif exc.errno != errno.ENOENT: