]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
use abs path for cache key
authorWing <SteelyWing@users.noreply.github.com>
Fri, 16 May 2014 19:36:57 +0000 (03:36 +0800)
committerWing <SteelyWing@users.noreply.github.com>
Fri, 16 May 2014 19:36:57 +0000 (03:36 +0800)
jinja2/environment.py

index 45fabada2eb238504e1c0ccda6e42fd9cf2e707e..424335df659aad996a4391918ef6e9c9110a9955 100644 (file)
@@ -757,14 +757,16 @@ class Environment(object):
     def _load_template(self, name, globals):
         if self.loader is None:
             raise TypeError('no loader for this environment specified')
+        # use abs path to store cache
+        cache_key = self.loader.get_source(self, name)[1]
         if self.cache is not None:
-            template = self.cache.get(name)
+            template = self.cache.get(cache_key)
             if template is not None and (not self.auto_reload or \
                                          template.is_up_to_date):
                 return template
         template = self.loader.load(self, name, globals)
         if self.cache is not None:
-            self.cache[name] = template
+            self.cache[cache_key] = template
         return template
 
     @internalcode