]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Don't check for generator if not needed 799/head
authorMartin Krizek <martin.krizek@gmail.com>
Wed, 17 Jan 2018 22:09:23 +0000 (23:09 +0100)
committerMartin Krizek <martin.krizek@gmail.com>
Wed, 17 Jan 2018 22:09:23 +0000 (23:09 +0100)
jinja2/nativetypes.py

index fcfeddfe501bf376aa5c87162ca12398d9a6c209..31309bca7fae4e4c148fa08f1e91ae45f9257f05 100644 (file)
@@ -21,12 +21,11 @@ def native_concat(nodes):
     if not head:
         return None
 
-    if isinstance(nodes, types.GeneratorType):
-        nodes = chain(head, nodes)
-
     if len(head) == 1:
         out = head[0]
     else:
+        if isinstance(nodes, types.GeneratorType):
+            nodes = chain(head, nodes)
         out = u''.join([text_type(v) for v in nodes])
 
     try: