tests: avoid implicit conversion of str to unicode
On Python 2, str.encode('ascii') implicitly converts the string to unicode and
then back to str.
Since the point of this expression is to convert a bool to a str, the '%r'
conversion specifier can be used instead in the format string.
--- a/tests/run-tests.py Tue Feb 18 19:11:13 2020 +0100
+++ b/tests/run-tests.py Thu Mar 05 18:10:19 2020 +0100
@@ -1428,7 +1428,7 @@
)
hgrc.write(b'[web]\n')
hgrc.write(b'address = localhost\n')
- hgrc.write(b'ipv6 = %s\n' % str(self._useipv6).encode('ascii'))
+ hgrc.write(b'ipv6 = %r\n' % self._useipv6)
hgrc.write(b'server-header = testing stub value\n')
for opt in self._extraconfigopts: