Improve the PackageLoader error message

This exception is raised when the `package_path` directory (default "templates") is not
found, so explain this.
This commit is contained in:
Lily Foote 2022-08-11 15:22:08 +01:00 committed by David Lord
parent 58a358f092
commit f54fa113d3
No known key found for this signature in database
GPG Key ID: 43368A7AA8CC5926

View File

@ -353,8 +353,8 @@ class PackageLoader(BaseLoader):
if template_root is None:
raise ValueError(
f"The {package_name!r} package was not installed in a"
" way that PackageLoader understands."
f"PackageLoader could not find a '{package_path}' directory for the "
f"{package_name!r} package."
)
self._template_root = template_root