Skip to content

Commit

Permalink
use abs path for cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
steelywing committed May 16, 2014
1 parent b7d13f2 commit 6671b97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jinja2/environment.py
Expand Up @@ -757,14 +757,16 @@ def join_path(self, template, parent):
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
Expand Down

0 comments on commit 6671b97

Please sign in to comment.