From d931b656f8113d5199456c56e51bce030bd34cc8 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sun, 6 May 2012 10:43:56 +0200 Subject: [PATCH] let Node.delete evict the node in question --- waflib/Node.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/waflib/Node.py b/waflib/Node.py index 59b9a281..1d45668a 100644 --- a/waflib/Node.py +++ b/waflib/Node.py @@ -188,7 +188,7 @@ class Node(object): os.chmod(self.abspath(), val) def delete(self): - """Delete the file/folder physically (but not the node)""" + """Delete the file/folders, and remove this node from the tree. It becomes invalid after that""" try: if getattr(self, 'children', None): shutil.rmtree(self.abspath()) @@ -196,11 +196,7 @@ class Node(object): os.unlink(self.abspath()) except OSError: pass - - try: - delattr(self, 'children') - except AttributeError: - pass + self.evict() def evict(self): """Internal - called when a node is removed"""