##// END OF EJS Templates
templater: restore use of callable() since it was readded in Python 3.2
Augie Fackler -
r21798:f2c617ff default
parent child Browse files
Show More
@@ -148,7 +148,7 b' def runsymbol(context, mapping, key):'
148 148 v = context.process(key, mapping)
149 149 except TemplateNotFound:
150 150 v = ''
151 if util.safehasattr(v, '__call__'):
151 if callable(v):
152 152 return v(**mapping)
153 153 if isinstance(v, types.GeneratorType):
154 154 v = list(v)
@@ -185,7 +185,7 b' def runtemplate(context, mapping, templa'
185 185 def runmap(context, mapping, data):
186 186 func, data, ctmpl = data
187 187 d = func(context, mapping, data)
188 if util.safehasattr(d, '__call__'):
188 if callable(d):
189 189 d = d()
190 190
191 191 lm = mapping.copy()
@@ -335,7 +335,7 b' def join(context, mapping, args):'
335 335 raise error.ParseError(_("join expects one or two arguments"))
336 336
337 337 joinset = args[0][0](context, mapping, args[0][1])
338 if util.safehasattr(joinset, '__call__'):
338 if callable(joinset):
339 339 jf = joinset.joinfmt
340 340 joinset = [jf(x) for x in joinset()]
341 341
General Comments 0
You need to be logged in to leave comments. Login now