changeset 207:c5330cb35794

processing: Don't fail if an asset we want to remove has already been removed.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 22 Jan 2015 22:23:20 -0800
parents cba781477bd0
children 989d0abd7c17
files piecrust/processing/base.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/processing/base.py	Sun Jan 18 12:13:28 2015 -0800
+++ b/piecrust/processing/base.py	Thu Jan 22 22:23:20 2015 -0800
@@ -246,7 +246,10 @@
         if delete and not new_only:
             for path, reason in record.getDeletions():
                 logger.debug("Removing '%s': %s" % (path, reason))
-                os.remove(path)
+                try:
+                    os.remove(path)
+                except FileNotFoundError:
+                    pass
                 logger.info('[delete] %s' % path)
 
         # Invoke post-processors.