From: Armin Ronacher <armin.ronacher@active-4.com> Date: Tue, 7 Jul 2009 11:22:34 +0000 (+0200) Subject: explanation for a strange monkey patch in django2jinja (thanks djc) X-Git-Tag: 2.2~15^2~1^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=db19b3045e1475766a78b0c9762a4f11e34d1bbf;p=jinja2.git explanation for a strange monkey patch in django2jinja (thanks djc) --HG-- branch : trunk --- diff --git a/ext/django2jinja/django2jinja.py b/ext/django2jinja/django2jinja.py index 9dae009..6d9e76c 100644 --- a/ext/django2jinja/django2jinja.py +++ b/ext/django2jinja/django2jinja.py @@ -86,7 +86,10 @@ _resolved_filters = {} _newline_re = re.compile(r'(?:\r\n|\r|\n)') -# don't ask.... +# Django stores an itertools object on the cycle node. Not only is this +# thread unsafe but also a problem for the converter which needs the raw +# string values passed to the constructor to create a jinja loop.cycle() +# call from it. _old_cycle_init = core_tags.CycleNode.__init__ def _fixed_cycle_init(self, cyclevars, variable_name=None): self.raw_cycle_vars = map(Variable, cyclevars)