extensions: restore use of callable() since it was readded in Python 3.2
authorAugie Fackler <raf@durin42.com>
Mon, 23 Jun 2014 09:24:06 -0400
changeset 21795 711498bb4ff5
parent 21794 753af9ee7c81
child 21796 8225bb1f0ad3
extensions: restore use of callable() since it was readded in Python 3.2
mercurial/extensions.py
--- a/mercurial/extensions.py	Mon Jun 23 09:24:16 2014 -0400
+++ b/mercurial/extensions.py	Mon Jun 23 09:24:06 2014 -0400
@@ -138,7 +138,7 @@
     where orig is the original (wrapped) function, and *args, **kwargs
     are the arguments passed to it.
     '''
-    assert util.safehasattr(wrapper, '__call__')
+    assert callable(wrapper)
     aliases, entry = cmdutil.findcmd(command, table)
     for alias, e in table.iteritems():
         if e is entry:
@@ -191,12 +191,12 @@
     your end users, you should play nicely with others by using the
     subclass trick.
     '''
-    assert util.safehasattr(wrapper, '__call__')
+    assert callable(wrapper)
     def wrap(*args, **kwargs):
         return wrapper(origfn, *args, **kwargs)
 
     origfn = getattr(container, funcname)
-    assert util.safehasattr(origfn, '__call__')
+    assert callable(origfn)
     setattr(container, funcname, wrap)
     return origfn