TypeError.__init__(self, message)
-class TemplateNotFound(IOError, TemplateError):
+class TemplateNotFound(IOError, LookupError, TemplateError):
"""
Raised if a template does not exist.
"""
def get_source(self, environment, name, parent):
filename = get_template_filename(self.searchpath, name)
- if path.exists(filename):
+ if path.isfile(filename):
f = codecs.open(filename, 'r', environment.template_charset)
try:
return f.read()
def check_source_changed(self, environment, name):
filename = get_template_filename(self.searchpath, name)
- if path.exists(filename):
+ if path.isfile(filename):
return path.getmtime(filename)
return -1
self.package_path.split('/') +
[p for p in name.split('/') if p != '..'])
)
- if path.exists(filename):
+ if path.isfile(filename):
f = file(filename)
try:
return f.read()