Mercurial > hg-stable
changeset 21795:711498bb4ff5
extensions: 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:06 -0400 |
parents | 753af9ee7c81 |
children | 8225bb1f0ad3 |
files | mercurial/extensions.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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