changeset 499:a406b75c4bea

sass: Overwrite the old map file with the new one always.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 23 Jul 2015 23:03:33 -0700
parents 35d4c172e5a6
children 22a230d99621
files piecrust/processing/sass.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/processing/sass.py	Thu Jul 23 23:02:07 2015 -0700
+++ b/piecrust/processing/sass.py	Thu Jul 23 23:03:33 2015 -0700
@@ -101,10 +101,9 @@
         if self.app.cache.enabled:
             src_map_file = out_path + '.map'
             dst_map_file = self._getMapPath(in_path)
-            try:
-                os.rename(src_map_file, dst_map_file)
-            except OSError:
-                pass
+            if os.path.exists(dst_map_file):
+                os.remove(dst_map_file)
+            os.rename(src_map_file, dst_map_file)
 
         if retcode != 0:
             raise Exception("Error occured in Sass compiler. Please check "