registrar: make format strings unicodes and not bytes
authorAugie Fackler <augie@google.com>
Fri, 07 Oct 2016 08:32:18 -0400
changeset 30059 6ffb7e0249f4
parent 30058 8f54f9b8010d
child 30060 a145161debed
registrar: make format strings unicodes and not bytes Fixes issues on Python 3, wherein docstrings are unicodes. Shouldn't break anything on Python 2.
mercurial/registrar.py
--- a/mercurial/registrar.py	Mon Oct 03 03:37:10 2016 +0100
+++ b/mercurial/registrar.py	Fri Oct 07 08:32:18 2016 -0400
@@ -8,6 +8,7 @@
 from __future__ import absolute_import
 
 from . import (
+    pycompat,
     util,
 )
 
@@ -121,7 +122,7 @@
     Otherwise, explicit 'revset.loadpredicate()' is needed.
     """
     _getname = _funcregistrarbase._parsefuncdecl
-    _docformat = "``%s``\n    %s"
+    _docformat = pycompat.sysstr("``%s``\n    %s")
 
     def _extrasetup(self, name, func, safe=False, takeorder=False):
         func._safe = safe
@@ -160,7 +161,7 @@
     Otherwise, explicit 'fileset.loadpredicate()' is needed.
     """
     _getname = _funcregistrarbase._parsefuncdecl
-    _docformat = "``%s``\n    %s"
+    _docformat = pycompat.sysstr("``%s``\n    %s")
 
     def _extrasetup(self, name, func, callstatus=False, callexisting=False):
         func._callstatus = callstatus
@@ -169,7 +170,7 @@
 class _templateregistrarbase(_funcregistrarbase):
     """Base of decorator to register functions as template specific one
     """
-    _docformat = ":%s: %s"
+    _docformat = pycompat.sysstr(":%s: %s")
 
 class templatekeyword(_templateregistrarbase):
     """Decorator to register template keyword