# HG changeset patch # User Jun Wu <quark@fb.com> # Date 2017-09-05 22:18:45 # 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 --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -377,7 +377,8 @@ def wrapcommand(table, command, wrapper, 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