From 73f27f5b32c8264de7fb215d84c97a5271a00364 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 6 Jun 2014 22:40:02 +0600 Subject: [PATCH] Make sure filtering returns a list for template listing. --- jinja2/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jinja2/environment.py b/jinja2/environment.py index d65059a0..7cdce6ff 100644 --- a/jinja2/environment.py +++ b/jinja2/environment.py @@ -717,7 +717,7 @@ class Environment(object): filter_func = lambda x: '.' in x and \ x.rsplit('.', 1)[1] in extensions if filter_func is not None: - x = ifilter(filter_func, x) + x = list(ifilter(filter_func, x)) return x def handle_exception(self, exc_info=None, rendered=False, source_hint=None): -- 2.47.2