# HG changeset patch # User Augie Fackler # Date 2014-06-23 13:24:06 # Node ID 711498bb4ff58874b4920b89a3398aa91ead9060 # Parent 753af9ee7c811d16af668c40072c597608da2a7b extensions: restore use of callable() since it was readded in Python 3.2 diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -138,7 +138,7 @@ def wrapcommand(table, command, wrapper) 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 @@ def wrapfunction(container, funcname, wr 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