MCPcopy
hub / github.com/pallets/jinja / get_eval_context

Function get_eval_context

src/jinja2/nodes.py:94–102  ·  view source on GitHub ↗
(node: "Node", ctx: t.Optional[EvalContext])

Source from the content-addressed store, hash-verified

92
93
94def get_eval_context(node: "Node", ctx: t.Optional[EvalContext]) -> EvalContext:
95 if ctx is None:
96 if node.environment is None:
97 raise RuntimeError(
98 "if no eval context is passed, the node must have an"
99 " attached environment."
100 )
101 return EvalContext(node.environment)
102 return ctx
103
104
105class Node(metaclass=NodeType):

Callers 15

as_constMethod · 0.85
as_constMethod · 0.85
as_constMethod · 0.85
as_constMethod · 0.85
as_constMethod · 0.85
as_constMethod · 0.85
as_constMethod · 0.85
as_constMethod · 0.85
as_constMethod · 0.85
as_constMethod · 0.85
as_constMethod · 0.85
as_constMethod · 0.85

Calls 1

EvalContextClass · 0.85

Tested by

no test coverage detected