changeset 21798:f2c617ff2abc

templater: restore use of callable() since it was readded in Python 3.2
author Augie Fackler <raf@durin42.com>
date Mon, 23 Jun 2014 09:24:56 -0400
parents b009dd135aa0
children dfacdd6a111e
files mercurial/templater.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Mon Jun 23 09:24:38 2014 -0400
+++ b/mercurial/templater.py	Mon Jun 23 09:24:56 2014 -0400
@@ -148,7 +148,7 @@
             v = context.process(key, mapping)
         except TemplateNotFound:
             v = ''
-    if util.safehasattr(v, '__call__'):
+    if callable(v):
         return v(**mapping)
     if isinstance(v, types.GeneratorType):
         v = list(v)
@@ -185,7 +185,7 @@
 def runmap(context, mapping, data):
     func, data, ctmpl = data
     d = func(context, mapping, data)
-    if util.safehasattr(d, '__call__'):
+    if callable(d):
         d = d()
 
     lm = mapping.copy()
@@ -335,7 +335,7 @@
         raise error.ParseError(_("join expects one or two arguments"))
 
     joinset = args[0][0](context, mapping, args[0][1])
-    if util.safehasattr(joinset, '__call__'):
+    if callable(joinset):
         jf = joinset.joinfmt
         joinset = [jf(x) for x in joinset()]