--- a/tests/test-config-env.py Sun Mar 04 15:24:45 2018 -0500
+++ b/tests/test-config-env.py Sun Mar 04 15:26:26 2018 -0500
@@ -11,24 +11,24 @@
util,
)
-testtmp = encoding.environ['TESTTMP']
+testtmp = encoding.environ[b'TESTTMP']
# prepare hgrc files
def join(name):
return os.path.join(testtmp, name)
-with open(join('sysrc'), 'w') as f:
- f.write('[ui]\neditor=e0\n[pager]\npager=p0\n')
+with open(join(b'sysrc'), 'wb') as f:
+ f.write(b'[ui]\neditor=e0\n[pager]\npager=p0\n')
-with open(join('userrc'), 'w') as f:
- f.write('[ui]\neditor=e1')
+with open(join(b'userrc'), 'wb') as f:
+ f.write(b'[ui]\neditor=e1')
# replace rcpath functions so they point to the files above
def systemrcpath():
- return [join('sysrc')]
+ return [join(b'sysrc')]
def userrcpath():
- return [join('userrc')]
+ return [join(b'userrc')]
rcutil.systemrcpath = systemrcpath
rcutil.userrcpath = userrcpath
@@ -41,9 +41,10 @@
ui = uimod.ui.load()
for section, name, value in ui.walkconfig():
source = ui.configsource(section, name)
- print('%s.%s=%s # %s' % (section, name, value, util.pconvert(source)))
- print('')
+ util.stdout.write(b'%s.%s=%s # %s\n'
+ % (section, name, value, util.pconvert(source)))
+ util.stdout.write(b'\n')
# environment variable overrides
printconfigs({})
-printconfigs({'EDITOR': 'e2', 'PAGER': 'p2'})
+printconfigs({b'EDITOR': b'e2', b'PAGER': b'p2'})