From 08a6faef2e05903183e77df0db9da3c5ac522bca Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Wed, 17 Jan 2018 23:09:23 +0100 Subject: [PATCH] Don't check for generator if not needed --- jinja2/nativetypes.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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: -- 2.47.2