[Checkins] SVN: Sandbox/malthe/chameleon.core/ Protect all `itertools.chain` statements with an encapsulating set() to ensure uniqueness.

Hanno Schlichting plone at hannosch.info
Sat Nov 29 16:15:27 EST 2008


Log message for revision 93447:
  Protect all `itertools.chain` statements with an encapsulating set() to ensure uniqueness.
  

Changed:
  U   Sandbox/malthe/chameleon.core/CHANGES.txt
  U   Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py

-=-
Modified: Sandbox/malthe/chameleon.core/CHANGES.txt
===================================================================
--- Sandbox/malthe/chameleon.core/CHANGES.txt	2008-11-29 19:09:38 UTC (rev 93446)
+++ Sandbox/malthe/chameleon.core/CHANGES.txt	2008-11-29 21:15:27 UTC (rev 93447)
@@ -4,6 +4,9 @@
 HEAD
 ~~~~
 
+- Protect all `itertools.chain` statements with an encapsulating set() to
+  ensure uniqueness. [hannosch]
+
 1.0b11 (released 29/11/2008)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Modified: Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py
===================================================================
--- Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py	2008-11-29 19:09:38 UTC (rev 93446)
+++ Sandbox/malthe/chameleon.core/src/chameleon/core/translation.py	2008-11-29 21:15:27 UTC (rev 93447)
@@ -352,7 +352,7 @@
             # compute macro function arguments and create argument string
             arguments = ", ".join(
                 ("%s=%s" % (arg, arg) for arg in \
-                 itertools.chain(*self.stream.scope)))
+                 set(itertools.chain(*self.stream.scope))))
 
             # XInclude's are similar to METAL macros, except the macro
             # is always defined as the entire template.
@@ -391,7 +391,7 @@
 
                 scope_args = tuple(
                     "%s=%s" % (variable, variable) for variable in \
-                    itertools.chain(*self.stream.scope))
+                    set(itertools.chain(*self.stream.scope)))
 
                 init_stream = types.value('_init_stream()')
                 init_stream.symbol_mapping['_init_stream'] = generation.initialize_stream



More information about the Checkins mailing list