pallets / jinja

A very fast and expressive template engine.
https://jinja.palletsprojects.com
BSD 3-Clause "New" or "Revised" License
10.23k stars 1.6k forks source link

[#1927] Raise exception on invalid input in indent #1928

Closed alex-harvey-z3q closed 7 months ago

alex-harvey-z3q commented 7 months ago

Before this change, the indent filter would raise a confusing error like the following if an unexpected input type was sent e.g. a dict:

unsupported operand type(s) for +=: 'dict' and 'str'"

This updates the code to fail gracefully and adds a new test.

Checklist: