From 5cd466a679dc46528c37936d7ac5c590aa544ba3 Mon Sep 17 00:00:00 2001 From: Paul Bonser Date: Thu, 13 May 2010 07:03:30 +0800 Subject: [PATCH] an object can have a __call__ attribute and not actually be callable --- pystache/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pystache/template.py b/pystache/template.py index 0d1c7326..1cb19c14 100644 --- a/pystache/template.py +++ b/pystache/template.py @@ -80,7 +80,7 @@ def render_sections(self, template, context): it = get_or_attr(context, section_name, None) replacer = '' - if it and hasattr(it, '__call__'): + if it and callable(it): replacer = it(inner) elif it and not hasattr(it, '__iter__'): if section[2] != '^':