# HG changeset patch # User Augie Fackler # Date 2017-10-14 16:02:15 # Node ID daf12f69699f60178ec7db377006af3ba4916999 # Parent a288712d86d5fc28c9f8f233d87791d97c03379f python3: replace im_{self,func} with __{self,func}__ globally These new names are portable back to Python 2.6. Differential Revision: https://phab.mercurial-scm.org/D1091 diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -112,7 +112,7 @@ class remoteiterbatcher(peer.iterbatcher for command, args, opts, finalfuture in self.calls: mtd = getattr(self._remote, command) - batchable = mtd.batchable(mtd.im_self, *args, **opts) + batchable = mtd.batchable(mtd.__self__, *args, **opts) commandargs, fremote = next(batchable) assert fremote diff --git a/tests/test-lock.py b/tests/test-lock.py --- a/tests/test-lock.py +++ b/tests/test-lock.py @@ -19,7 +19,7 @@ testlockname = 'testlock' # work around http://bugs.python.org/issue1515 if types.MethodType not in copy._deepcopy_dispatch: def _deepcopy_method(x, memo): - return type(x)(x.im_func, copy.deepcopy(x.im_self, memo), x.im_class) + return type(x)(x.__func__, copy.deepcopy(x.__self__, memo), x.im_class) copy._deepcopy_dispatch[types.MethodType] = _deepcopy_method class lockwrapper(lock.lock):