Show More
@@ -913,7 +913,8 b' class loader(object):' | |||
|
913 | 913 | """Get parsed tree for the given template name. Use a local cache.""" |
|
914 | 914 | if t not in self.cache: |
|
915 | 915 | try: |
|
916 |
|
|
|
916 | mapfile, fp = open_template(self._map[t]) | |
|
917 | self.cache[t] = fp.read() | |
|
917 | 918 | except KeyError as inst: |
|
918 | 919 | raise templateutil.TemplateNotFound( |
|
919 | 920 | _(b'"%s" not in template map') % inst.args[0] |
@@ -1092,7 +1093,7 b' def open_template(name, templatepath=Non' | |||
|
1092 | 1093 | will then be the relative path. |
|
1093 | 1094 | ''' |
|
1094 | 1095 | # Does the name point directly to a map file? |
|
1095 | if os.path.isabs(name): | |
|
1096 | if os.path.isfile(name) or os.path.isabs(name): | |
|
1096 | 1097 | return name, open(name, mode='rb') |
|
1097 | 1098 | |
|
1098 | 1099 | # Does the name point to a template in the provided templatepath, or |
General Comments 0
You need to be logged in to leave comments.
Login now