# HG changeset patch # User Jun Wu # Date 1504649925 25200 # Node ID a763c891f36e55f4869f443c220227d1da747d18 # Parent 5361771f97140ee44e213112bafd81d84d64001e wrapcommand: use functools.partial Like the previous patch, this helps remove noises in traceback. Practically, this removes another 6 lines in `rebase -s . -d .` traceback in my setup: .... File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) -File "hg/mercurial/extensions.py", line 331, in closure - return func(*(args + a), **kw) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) File "fb-hgext/hgext3rd/fbhistedit.py", line 283, in _rebase return orig(ui, repo, **opts) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) -File "hg/mercurial/extensions.py", line 331, in closure - return func(*(args + a), **kw) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) File "remotenames.py", line 633, in exrebasecmd ret = orig(ui, repo, **opts) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) -File "hg/mercurial/extensions.py", line 331, in closure - return func(*(args + a), **kw) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) File "fb-hgext/hgext3rd/fbamend/__init__.py", line 453, in wraprebase return orig(ui, repo, **opts) File "hg/mercurial/util.py", line 1118, in check return func(*args, **kwargs) .... Differential Revision: https://phab.mercurial-scm.org/D633 diff -r 5361771f9714 -r a763c891f36e mercurial/extensions.py --- a/mercurial/extensions.py Tue Sep 05 13:37:36 2017 -0700 +++ b/mercurial/extensions.py Tue Sep 05 15:18:45 2017 -0700 @@ -377,7 +377,8 @@ break origfn = entry[0] - wrap = bind(util.checksignature(wrapper), util.checksignature(origfn)) + wrap = functools.partial(util.checksignature(wrapper), + util.checksignature(origfn)) _updatewrapper(wrap, origfn, wrapper) if docstring is not None: wrap.__doc__ += docstring