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:
committed by
Richard Purdie
parent
c405a3a13e
commit
2ef204dcdd
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user