Updates for Jinja2 >= 3.1.x#76
Open
raffienficiaud wants to merge 1 commit intochristopher-ramirez:masterfrom
Open
Updates for Jinja2 >= 3.1.x#76raffienficiaud wants to merge 1 commit intochristopher-ramirez:masterfrom
raffienficiaud wants to merge 1 commit intochristopher-ramirez:masterfrom
Conversation
raffienficiaud
commented
Mar 28, 2022
- importing Markup from MarkupSafe
- replacing evalcontextfilter by pass_eval_context
- making the dependency explicit
* importing Markup from MarkupSafe * replacing evalcontextfilter by pass_eval_context * making the dependency explicit
Author
j123b567
reviewed
Jun 22, 2022
| self._compile_tags_expressions() | ||
|
|
||
| @jinja2.evalcontextfilter | ||
| @jinja2.pass_eval_context |
Contributor
There was a problem hiding this comment.
It is stated in the jinja2 documentation that one should use pass_eval_context instead of evalcontextfilter but it is not true for this code. In that case, document will be full of <jinja2.nodes.EvalContext object at 0x.....> because the decorator injects first argument, which is not expected here.
Better would be to add context argument
@jinja2.pass_eval_context
def finalize_value(self, ctx, value, *args):but I don't know any usage for it. I also don't understand, why it even works with previous Jinja versions.
So, the best solution seems to be to completeldy remove the decorator.
Author
There was a problem hiding this comment.
Comment addressed in raffienficiaud#1 : works without issue without those decorators.
Author
|
This work is being superseded by this PR: raffienficiaud#1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.