diff options
author | Marc Abramowitz <marc@marc-abramowitz.com> | 2013-06-05 22:40:03 -0700 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2013-08-07 12:30:38 +0100 |
commit | dc3b431829afa616f11f3d781bfabe573e54f40c (patch) | |
tree | b36bb0b2ce2739b5437bfefcd9aff704ea42d115 | |
parent | 10707853c4a0a02d52233581375be246e0d33598 (diff) | |
download | jinja2-dc3b431829afa616f11f3d781bfabe573e54f40c.tar.gz |
Fix Python 3 compatibility of BytecodeCache by checking for `if
isinstance(filename, text_type)` instead of `if isinstance(filename,
unicode)`
-rw-r--r-- | jinja2/bccache.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/jinja2/bccache.py b/jinja2/bccache.py index b534e27..f2f9db6 100644 --- a/jinja2/bccache.py +++ b/jinja2/bccache.py @@ -21,7 +21,7 @@ import tempfile import fnmatch from hashlib import sha1 from jinja2.utils import open_if_exists -from jinja2._compat import BytesIO, pickle, PY2 +from jinja2._compat import BytesIO, pickle, PY2, text_type # marshal works better on 3.x, one hack less required @@ -160,7 +160,7 @@ class BytecodeCache(object): hash = sha1(name.encode('utf-8')) if filename is not None: filename = '|' + filename - if isinstance(filename, unicode): + if isinstance(filename, text_type): filename = filename.encode('utf-8') hash.update(filename) return hash.hexdigest() |