Skip to content
Myr

Improve the PackageLoader error message

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

This exception is raised when the `package_path` directory (default "templates") is not found, so explain this.

authored by Lily Foote · committed by David Lord · parent 58a358f · Browse files · 1 file+2 added−2 removed
This commit

State

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

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:src/jinja2/loaders.py+2 added-2 removed
351 unmodified lines
352 break353354 if template_root is None:355 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."358 )359360 self._template_root = template_root361
328 unmodified lines