From 620dea5fb714beff0cd316c877f8089a2e9d2b00 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Mon, 22 Sep 2014 19:31:01 +0200 Subject: [PATCH] Issue 1487 - there can be race conditions or other kinds of errors to ignore --- waflib/Node.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/waflib/Node.py b/waflib/Node.py index bc829a79..33a5833f 100644 --- a/waflib/Node.py +++ b/waflib/Node.py @@ -187,13 +187,16 @@ class Node(object): os.chmod(self.abspath(), val) def delete(self): - """Delete the file/folders if it exists, and remove this node from the tree. Do not use this object after calling this method.""" + """Delete the file/folder, and remove this node from the tree. Do not use this object after calling this method.""" try: - if os.path.exists(self.abspath()): + try: if hasattr(self, 'children'): shutil.rmtree(self.abspath()) else: os.remove(self.abspath()) + except OSError as e: + if os.path.exists(self.abspath()): + raise e finally: self.evict()