build: make docs/conf.py compatible with py3
I don't even know what this file does, but it made our Debian build
fail on py3 because it attempted to pass unicode to
`mercurial.ui.setconfig()`.
--- a/docs/conf.py Fri Mar 06 21:37:28 2020 +0700
+++ b/docs/conf.py Fri Mar 06 14:35:35 2020 -0800
@@ -7,6 +7,7 @@
from mercurial import ui
from mercurial import extensions as hgext
from mercurial import commands
+from mercurial import pycompat
import os
extensions = ["sphinx.ext.graphviz"]
@@ -143,11 +144,13 @@
if not hasattr(u, 'disablepager'):
return []
u.disablepager()
- u.setconfig(
- 'extensions', 'evolve',
- os.path.join(
- os.path.abspath(os.path.dirname(__file__)),
- os.pardir, 'hgext3rd', 'evolve'))
+ import sys
+ print('version', sys.version_info)
+ print('__file__', type(__file__).__name__)
+ evolve_path = os.path.join(
+ os.path.abspath(os.path.dirname(__file__)),
+ os.pardir, 'hgext3rd', 'evolve')
+ u.setconfig(b'extensions', b'evolve', pycompat.fsencode(evolve_path))
hgext.loadall(u)
u.pushbuffer()
commands.help_(u, self.content[0].encode('utf-8'))