summaryrefslogtreecommitdiff
path: root/django/template
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2013-02-27 04:26:15 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-02-27 10:03:33 +0100
commitbbe8205693733bf38edaf12fa84bd06a1a00bd64 (patch)
tree221b7fd1a8947af226d1fe93438fd66c81a73790 /django/template
parent67f3a6e9cfe98b9376f90fc1b6f980570f3bcaa9 (diff)
[py3] Always fed hashlib with bytes.
Diffstat (limited to 'django/template')
-rw-r--r--django/template/loaders/cached.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/template/loaders/cached.py b/django/template/loaders/cached.py
index 4c25acd599..fb987a5e3a 100644
--- a/django/template/loaders/cached.py
+++ b/django/template/loaders/cached.py
@@ -6,6 +6,7 @@ to load templates from them in order, caching the result.
import hashlib
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader, get_template_from_string, find_template_loader, make_origin
+from django.utils.encoding import force_bytes
class Loader(BaseLoader):
is_usable = True
@@ -40,7 +41,7 @@ class Loader(BaseLoader):
key = template_name
if template_dirs:
# If template directories were specified, use a hash to differentiate
- key = '-'.join([template_name, hashlib.sha1('|'.join(template_dirs)).hexdigest()])
+ key = '-'.join([template_name, hashlib.sha1(force_bytes('|'.join(template_dirs))).hexdigest()])
if key not in self.template_cache:
template, origin = self.find_template(template_name, template_dirs)