Skip to content
Myr

jinja loaders check now if a file is a file and not a directory instead of using path.exists.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent c689cf1 · Browse files · 2 files+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−4 removed

  • other:+4 added−4 removed

2 files+4 added−4 removed

modified:jinja/exceptions.py+1 added-1 removed
54 unmodified lines
55 def __init__(self, message):56 TypeError.__init__(self, message)575859class TemplateNotFound(IOError, TemplateError):59class TemplateNotFound(IOError, LookupError, TemplateError):60 """61 Raised if a template does not exist.62 """63
28 unmodified lines
modified:jinja/loaders.py+3 added-3 removed
412 unmodified lines
413 self.searchpath = path.abspath(searchpath)414415 def get_source(self, environment, name, parent):416 filename = get_template_filename(self.searchpath, name)417 if path.exists(filename):417 if path.isfile(filename):418 f = codecs.open(filename, 'r', environment.template_charset)419 try:420 return f.read()421 finally:
50 unmodified lines
472 cache_folder, auto_reload, cache_salt)473474 def check_source_changed(self, environment, name):475 filename = get_template_filename(self.searchpath, name)476 if path.exists(filename):476 if path.isfile(filename):477 return path.getmtime(filename)478 return -1479480
80 unmodified lines
561 filename = path.join(basepath, *(562 self.package_path.split('/') +563 [p for p in name.split('/') if p != '..'])564 )565 if path.exists(filename):565 if path.isfile(filename):566 f = file(filename)567 try:568 return f.read()569 finally:
253 unmodified lines