diff piecrust/app.py @ 6:f5ca5c5bed85

More Python 3 fixes, modularization, and new unit tests.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 16 Aug 2014 08:15:30 -0700
parents 474c9882decf
children 3701daa97927
line wrap: on
line diff
--- a/piecrust/app.py	Mon Aug 11 22:36:47 2014 -0700
+++ b/piecrust/app.py	Sat Aug 16 08:15:30 2014 -0700
@@ -1,7 +1,6 @@
 import re
 import json
 import os.path
-import types
 import codecs
 import hashlib
 import logging
@@ -59,8 +58,8 @@
             return
 
         path_times = [os.path.getmtime(p) for p in self.paths]
-        cache_key = hashlib.md5("version=%s&cache=%d" % (
-                APP_VERSION, CACHE_VERSION)).hexdigest()
+        cache_key = hashlib.md5(("version=%s&cache=%d" % (
+                APP_VERSION, CACHE_VERSION)).encode('utf8')).hexdigest()
 
         if self.cache.isValid('config.json', path_times):
             logger.debug("Loading configuration from cache...")