From: Xinbin Huang Date: Wed, 8 Apr 2020 20:15:30 +0000 (-0700) Subject: Update oudated CutomLoader code example (#1185) X-Git-Tag: 3.0.0rc1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35aa1948c0e80ba864c949ec764edbe9debfc092;p=thirdparty%2Fjinja.git Update oudated CutomLoader code example (#1185) py3 for CustomLoader example --- diff --git a/src/jinja2/loaders.py b/src/jinja2/loaders.py index 6e546c00..09f678d7 100644 --- a/src/jinja2/loaders.py +++ b/src/jinja2/loaders.py @@ -55,8 +55,8 @@ class BaseLoader: if not exists(path): raise TemplateNotFound(template) mtime = getmtime(path) - with file(path) as f: - source = f.read().decode('utf-8') + with open(path) as f: + source = f.read() return source, path, lambda: mtime == getmtime(path) """