You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe add an else to the for which raises a different error?
Or that piece of code could be simplified down to something like:
try:
template_root = next(p for root in roots if os.path.isdir(p := os.path.join(root, package_path)))
except StopIteration:
raise ValueError(f"Template path not found in package: {package_path}.")
Or if you convert everything to Path, that can be simplified to next(p for root in roots if (p := root / package_path).is_dir()).
The text was updated successfully, but these errors were encountered:
Just spent 10 minutes trying to debug this error:
The package is absolutely fine. I just set the path to a non-existing path, so this code was never run:
https://github.com/pallets/jinja/blob/main/src/jinja2/loaders.py#L318-L320
Maybe add an
else
to thefor
which raises a different error?Or that piece of code could be simplified down to something like:
Or if you convert everything to
Path
, that can be simplified tonext(p for root in roots if (p := root / package_path).is_dir())
.The text was updated successfully, but these errors were encountered: