mirror of https://gitlab.com/ita1024/waf.git
Issue 1487 - delete files or folders only if they exist on the filesystem
This commit is contained in:
parent
f990fca8ff
commit
cb030505af
|
@ -187,8 +187,9 @@ class Node(object):
|
|||
os.chmod(self.abspath(), val)
|
||||
|
||||
def delete(self):
|
||||
"""Delete the file/folders, and remove this node from the tree. It becomes invalid after that"""
|
||||
"""Delete the file/folders if it exists, and remove this node from the tree. Do not use this object after calling this method."""
|
||||
try:
|
||||
if os.path.exists(self.abspath()):
|
||||
if hasattr(self, 'children'):
|
||||
shutil.rmtree(self.abspath())
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue