Skip to content

Commit

Permalink
Fix error message for non-existing directory
Browse files Browse the repository at this point in the history
  • Loading branch information
elektito committed Jun 6, 2024
1 parent 1470c17 commit 74488ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Unreleased
``Template.generate_async``. :pr:`1960`
- Avoid leaving async generators unclosed in blocks, includes and extends.
:pr:`1960`
- Fix misleading error message when template does not exist.
:pr:`1995`


Version 3.1.4
Expand Down
5 changes: 1 addition & 4 deletions src/jinja2/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,7 @@ def __init__(
break

if template_root is None:
raise ValueError(
f"The {package_name!r} package was not installed in a"
" way that PackageLoader understands."
)
raise ValueError("Template directory was not found.")

self._template_root = template_root

Expand Down

0 comments on commit 74488ac

Please sign in to comment.