##// END OF EJS Templates
extensions: restore use of callable() since it was readded in Python 3.2
Augie Fackler -
r21795:711498bb default
parent child Browse files
Show More
@@ -138,7 +138,7 b' def wrapcommand(table, command, wrapper)'
138 where orig is the original (wrapped) function, and *args, **kwargs
138 where orig is the original (wrapped) function, and *args, **kwargs
139 are the arguments passed to it.
139 are the arguments passed to it.
140 '''
140 '''
141 assert util.safehasattr(wrapper, '__call__')
141 assert callable(wrapper)
142 aliases, entry = cmdutil.findcmd(command, table)
142 aliases, entry = cmdutil.findcmd(command, table)
143 for alias, e in table.iteritems():
143 for alias, e in table.iteritems():
144 if e is entry:
144 if e is entry:
@@ -191,12 +191,12 b' def wrapfunction(container, funcname, wr'
191 your end users, you should play nicely with others by using the
191 your end users, you should play nicely with others by using the
192 subclass trick.
192 subclass trick.
193 '''
193 '''
194 assert util.safehasattr(wrapper, '__call__')
194 assert callable(wrapper)
195 def wrap(*args, **kwargs):
195 def wrap(*args, **kwargs):
196 return wrapper(origfn, *args, **kwargs)
196 return wrapper(origfn, *args, **kwargs)
197
197
198 origfn = getattr(container, funcname)
198 origfn = getattr(container, funcname)
199 assert util.safehasattr(origfn, '__call__')
199 assert callable(origfn)
200 setattr(container, funcname, wrap)
200 setattr(container, funcname, wrap)
201 return origfn
201 return origfn
202
202
General Comments 0
You need to be logged in to leave comments. Login now