Patchwork D1065: python3: move from using func_name to __name__

login
register
mail settings
Submitter phabricator
Date Oct. 14, 2017, 7:03 a.m.
Message ID <differential-rev-PHID-DREV-wcbva4jxdg2tfbf6xlfe-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/24881/
State Superseded
Headers show

Comments

phabricator - Oct. 14, 2017, 7:03 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Previously reviewed as https://phab.mercurial-scm.org/D964, but required some fixups and therefore
  seems to need a new revision.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/peer.py
  mercurial/templater.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 14, 2017, 11:48 a.m.
yuja added a comment.


  This is queued, but we'll need to wrap __name__ with sysbytes() for py3.

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -427,9 +427,9 @@ 
         sym = findsymbolicname(arg)
         if sym:
             msg = (_("template filter '%s' is not compatible with keyword '%s'")
-                   % (filt.func_name, sym))
+                   % (filt.__name__, sym))
         else:
-            msg = _("incompatible use of template filter '%s'") % filt.func_name
+            msg = _("incompatible use of template filter '%s'") % filt.__name__
         raise error.Abort(msg)
 
 def buildmap(exp, context):
diff --git a/mercurial/peer.py b/mercurial/peer.py
--- a/mercurial/peer.py
+++ b/mercurial/peer.py
@@ -90,7 +90,7 @@ 
         if not encresref:
             return encargsorres # a local result in this case
         self = args[0]
-        encresref.set(self._submitone(f.func_name, encargsorres))
+        encresref.set(self._submitone(f.__name__, encargsorres))
         return next(batchable)
     setattr(plain, 'batchable', f)
     return plain