From: Martin Krizek Date: Wed, 17 Jan 2018 22:09:23 +0000 (+0100) Subject: Don't check for generator if not needed X-Git-Tag: 2.11.0~128^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F799%2Fhead;p=thirdparty%2Fjinja.git Don't check for generator if not needed --- diff --git a/jinja2/nativetypes.py b/jinja2/nativetypes.py index fcfeddfe..31309bca 100644 --- a/jinja2/nativetypes.py +++ b/jinja2/nativetypes.py @@ -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: