Patchwork D1091: python3: replace im_{self,func} with __{self,func}__ globally

login
register
mail settings
Submitter phabricator
Date Oct. 15, 2017, 1:27 p.m.
Message ID <36c444663adf5bc37af4f892297605f8@localhost.localdomain>
Download mbox | patch
Permalink /patch/24949/
State Not Applicable
Headers show

Comments

phabricator - Oct. 15, 2017, 1:27 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdaf12f69699f: python3: replace im_{self,func} with __{self,func}__ globally (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1091?vs=2771&id=2781

REVISION DETAIL
  https://phab.mercurial-scm.org/D1091

AFFECTED FILES
  mercurial/wireproto.py
  tests/test-lock.py

CHANGE DETAILS




To: durin42, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

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 @@ 
 # 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):
diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -112,7 +112,7 @@ 
 
         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