changeset 42:9e058e221108

Fix a crash when checking for timestamps on template files.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 21 Aug 2014 22:51:52 -0700
parents 1a30e3d7ee47
children f14889d6b067
files piecrust/baking/baker.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/baking/baker.py	Thu Aug 21 22:29:03 2014 -0700
+++ b/piecrust/baking/baker.py	Thu Aug 21 22:51:52 2014 -0700
@@ -320,9 +320,10 @@
             # better just force a bake from scratch if that's the case.
             max_time = 0
             for d in self.app.templates_dirs:
-                for _, __, filenames in os.walk(d):
+                for dpath, _, filenames in os.walk(d):
                     for fn in filenames:
-                        max_time = max(max_time, os.path.getmtime(fn))
+                        full_fn = os.path.join(dpath, fn)
+                        max_time = max(max_time, os.path.getmtime(full_fn))
             if max_time >= record.previous.bake_time:
                 reason = "templates modified"