Patchwork D1145: templater: use pycompat.sysbytes to bytes-ify some __name__ attrs

login
register
mail settings
Submitter phabricator
Date Oct. 17, 2017, 2:52 p.m.
Message ID <differential-rev-PHID-DREV-aamwkmh7tv6c55jtqz2a-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25104/
State Superseded
Headers show

Comments

phabricator - Oct. 17, 2017, 2:52 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Spotted by yuya in review of https://phab.mercurial-scm.org/rHGe87e62b7fc0bf6debd4db89e3a902eafb97dcb98.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/templater.py

CHANGE DETAILS




To: durin42, #hg-reviewers
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,10 @@ 
         sym = findsymbolicname(arg)
         if sym:
             msg = (_("template filter '%s' is not compatible with keyword '%s'")
-                   % (filt.__name__.encode('ascii'), sym))
+                   % (pycompat.sysbytes(filt.__name__), sym))
         else:
-            msg = _("incompatible use of template filter '%s'") % filt.__name__
+            msg = _("incompatible use of template filter '%s'") % (
+                pycompat.sysbytes(filt.__name__))
         raise error.Abort(msg)
 
 def buildmap(exp, context):