FileSystemLoader includes search paths in error
This commit is contained in:
parent
b4b28ec01c
commit
ed5f76206a
@ -35,6 +35,8 @@ Unreleased
|
||||
- Fix `copy`/`pickle` support for the internal ``missing`` object.
|
||||
:issue:`2027`
|
||||
- ``Environment.overlay(enable_async)`` is applied correctly. :pr:`2061`
|
||||
- Paths where the loader searched for the template were added
|
||||
to the error message. :issue:`1661`
|
||||
|
||||
|
||||
Version 3.1.4
|
||||
|
||||
@ -204,7 +204,10 @@ class FileSystemLoader(BaseLoader):
|
||||
if os.path.isfile(filename):
|
||||
break
|
||||
else:
|
||||
raise TemplateNotFound(template)
|
||||
raise TemplateNotFound(
|
||||
f"{template} not found in the following search path(s):"
|
||||
f" {self.searchpath}"
|
||||
)
|
||||
|
||||
with open(filename, encoding=self.encoding) as f:
|
||||
contents = f.read()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user