py3: convert _origdoc to sysstr to match __doc__
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 09 Jul 2019 10:56:42 -0700
changeset 4718 23323092f0a7
parent 4717 7b36f9728351
child 4719 358f548f8d6d
py3: convert _origdoc to sysstr to match __doc__ It's currently stored as bytes by core, so we need to convert it to match Python's expected type for __doc__. This patch can be dropped if D6623 gets accepted.
hgext3rd/evolve/templatekw.py
--- a/hgext3rd/evolve/templatekw.py	Tue Jul 09 10:56:42 2019 -0700
+++ b/hgext3rd/evolve/templatekw.py	Tue Jul 09 10:56:42 2019 -0700
@@ -15,6 +15,7 @@
 )
 
 from mercurial import (
+    pycompat,
     templatekw,
     util
 )
@@ -58,7 +59,7 @@
 if util.safehasattr(_sp, '_requires'):
     def showprecursors(context, mapping):
         return _sp(context, mapping)
-    showprecursors.__doc__ = _sp._origdoc
+    showprecursors.__doc__ = pycompat.sysstr(_sp._origdoc)
     _tk = templatekw.templatekeyword("precursors", requires=_sp._requires)
     _tk(showprecursors)
 else:
@@ -74,7 +75,7 @@
 if util.safehasattr(_ss, '_requires'):
     def showsuccessors(context, mapping):
         return _ss(context, mapping)
-    showsuccessors.__doc__ = _ss._origdoc
+    showsuccessors.__doc__ = pycompat.sysstr(_ss._origdoc)
     _tk = templatekw.templatekeyword("successors", requires=_ss._requires)
     _tk(showsuccessors)
 else: