Skip to content

Commit f54fa11

Browse files
LilyFireflydavidism
authored andcommitted
Improve the PackageLoader error message
This exception is raised when the `package_path` directory (default "templates") is not found, so explain this.
1 parent 58a358f commit f54fa11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/jinja2/loaders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ def __init__(
353353

354354
if template_root is None:
355355
raise ValueError(
356-
f"The {package_name!r} package was not installed in a"
357-
" way that PackageLoader understands."
356+
f"PackageLoader could not find a '{package_path}' directory for the "
357+
f"{package_name!r} package."
358358
)
359359

360360
self._template_root = template_root

0 commit comments

Comments
 (0)