Skip to content
Myr

Merge branch 'master' into sprint-branch

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parents e2fc874, b9c76fb · Browse files · 5 files+7 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+7 added−7 removed

  • other:+7 added−7 removed

5 files+7 added−7 removed

modified:docs/faq.rst+1 added-1 removed
172 unmodified lines
173harder to maintain the code for older Python versions. If you really need174Python 2.3 support you either have to use `Jinja 1`_ or other templating175engines that still support 2.3.176177My Macros are overriden by something177My Macros are overridden by something178------------------------------------179180In some situations the Jinja scoping appears arbitrary:181
22 unmodified lines
modified:docs/templates.rst+1 added-1 removed
860 unmodified lines
861 <dd>{{ input_field('password', type='password') }}</dd>862 </dl>863 <p>{{ textarea('comment') }}</p>864865Macros and variables starting with one ore more underscores are private and865Macros and variables starting with one or more underscores are private and866cannot be imported.867868.. versionchanged:: 2.4869 If a template object was passed to the template context you can
512 unmodified lines
modified:ext/django2jinja/django2jinja.py+1 added-1 removed
607 unmodified lines
608609@node(core_tags.WithNode)610def with_block(writer, node):611 writer.warn('with block expanded into set statement. This could cause '612 'variables following that block to be overriden.', node)612 'variables following that block to be overridden.', node)613 writer.start_block()614 writer.write('set %s = ' % node.name)615 writer.node(node.var)616 writer.end_block()
152 unmodified lines
modified:jinja2/compiler.py+3 added-3 removed
663 unmodified lines
664 # assertion error. Reason: we can't generate reasonable code from665 # it without aliasing all the variables.666 # this could be fixed in Python 3 where we have the nonlocal667 # keyword or if we switch to bytecode generation668 overriden_closure_vars = (668 overridden_closure_vars = (669 func_frame.identifiers.undeclared &670 func_frame.identifiers.declared &671 (func_frame.identifiers.declared_locally |672 func_frame.identifiers.declared_parameter)673 )674 if overriden_closure_vars:674 if overridden_closure_vars:675 self.fail('It\'s not possible to set and access variables '676 'derived from an outer scope! (affects: %s)' %677 ', '.join(sorted(overriden_closure_vars)), node.lineno)677 ', '.join(sorted(overridden_closure_vars)), node.lineno)678679 # remove variables from a closure from the frame's undeclared680 # identifiers.681 func_frame.identifiers.undeclared -= (
961 unmodified lines
modified:jinja2/sandbox.py+1 added-1 removed
113 unmodified lines
114def is_internal_attribute(obj, attr):115 """Test if the attribute given is an internal python attribute. For116 example this function returns `True` for the `func_code` attribute of117 python objects. This is useful if the environment method118 :meth:`~SandboxedEnvironment.is_safe_attribute` is overriden.118 :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden.119120 >>> from jinja2.sandbox import is_internal_attribute121 >>> is_internal_attribute(lambda: None, "func_code")122 True
240 unmodified lines