Skip to content

Commit

Permalink
Print template path chain in TemplateNotFound exception
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarqu committed Jan 16, 2024
1 parent 80d5396 commit 65c2e63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sphinx/jinja2glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,4 @@ def get_source(self, environment: Environment, template: str) -> tuple[str, str,
return loader.get_source(environment, template)
except TemplateNotFound:
pass
raise TemplateNotFound(template)
raise TemplateNotFound(f"{template!r} not found in {self.environment.loader.pathchain}")

Check failure on line 221 in sphinx/jinja2glue.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (EM102)

sphinx/jinja2glue.py:221:32: EM102 Exception must not use an f-string literal, assign to variable first

Check failure on line 221 in sphinx/jinja2glue.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E501)

sphinx/jinja2glue.py:221:96: E501 Line too long (96 > 95)

0 comments on commit 65c2e63

Please sign in to comment.