]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Update oudated CutomLoader code example (#1185)
authorXinbin Huang <bin.huangxb@gmail.com>
Wed, 8 Apr 2020 20:15:30 +0000 (13:15 -0700)
committerGitHub <noreply@github.com>
Wed, 8 Apr 2020 20:15:30 +0000 (13:15 -0700)
py3 for CustomLoader example

src/jinja2/loaders.py

index 6e546c00b31f3b98fbc36bef83795690a782c15f..09f678d74b68b7d627d0eef0eec18e8b1753a840 100644 (file)
@@ -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)
     """