Allow to pass a list to native_concat
diff --git a/jinja2/nativetypes.py b/jinja2/nativetypes.py
index fe17e41..fcfeddf 100644
--- a/jinja2/nativetypes.py
+++ b/jinja2/nativetypes.py
@@ -1,4 +1,5 @@
import sys
+import types
from ast import literal_eval
from itertools import islice, chain
from jinja2 import nodes
@@ -20,10 +21,13 @@
if not head:
return None
+ if isinstance(nodes, types.GeneratorType):
+ nodes = chain(head, nodes)
+
if len(head) == 1:
out = head[0]
else:
- out = u''.join([text_type(v) for v in chain(head, nodes)])
+ out = u''.join([text_type(v) for v in nodes])
try:
return literal_eval(out)
diff --git a/tests/test_nativetypes.py b/tests/test_nativetypes.py
index aec1a3b..769bbc0 100644
--- a/tests/test_nativetypes.py
+++ b/tests/test_nativetypes.py
@@ -108,3 +108,9 @@
result = t.render()
assert not isinstance(result, type)
assert result in ["<type 'bool'>", "<class 'bool'>"]
+
+ def test_string(self, env):
+ t = env.from_string("[{{ 'all' }}]")
+ result = t.render()
+ assert isinstance(result, text_type)
+ assert result == "[all]"