Fix Delete action for non-existent files and must_exist=1 under Python 2.3. (Kevin...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 15 Sep 2004 01:27:00 +0000 (01:27 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 15 Sep 2004 01:27:00 +0000 (01:27 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1069 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Defaults.py

index ec8ac36a3b2336fb883a471ace53bdea78c150c5..feb988a236157b545ed2518edcb671a1c9ded239 100644 (file)
@@ -15,6 +15,10 @@ RELEASE 0.97 - XXX
   - Allow Help() to be called multiple times, appending to the help
     text each call.
 
+  From Steve Christensen:
+
+  - Handle exceptions from Python functions a build actions.
+
   From Steven Knight:
 
   - When compiling with Microsoft Visual Studio, don't include the ATL and
@@ -54,6 +58,11 @@ RELEASE 0.97 - XXX
   - Provide more info in the error message when a user tries to build
     a target multiple ways.
 
+  - Fix Delete() when a file doesn't exist and must_exist=1.  (We were
+    unintentionally dependent on a bug in versions of the Python shutil.py
+    module prior to Python 2.3, which would generate an exception for
+    a nonexistent file even when ignore_errors was set.)
+
   From Christoph Wiedemann:
 
   - Add an Environment.SetDefault() method that only sets values if
index a99850bfe6a8d2002c9edad791328bd3ed963d32..6ebc6ebb58509a65df60d3a3be4e823060903dcb 100644 (file)
@@ -184,7 +184,7 @@ Copy = ActionFactory(copy_func,
 def delete_func(entry, must_exist=0):
     if not must_exist and not os.path.exists(entry):
         return None
-    if os.path.isfile(entry):
+    if not os.path.exists(entry) or os.path.isfile(entry):
         return os.unlink(entry)
     else:
         return shutil.rmtree(entry, 1)