Mercurial > hg
diff tests/test-doctest.py @ 31439:b70407bd84d5
pycompat: add bytestr wrapper which mostly acts as a Python 2 str
This allows us to handle bytes in mostly the same manner as Python 2 str,
so we can get rid of ugly s[i:i + 1] hacks:
s = bytestr(s)
while i < len(s):
c = s[i]
...
This is the simpler version of the previous RFC patch which tried to preserve
the bytestr type if possible. New version simply drops the bytestr wrapping
so we aren't likely to pass a bytestr to a function that expects Python 3
bytes.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 08 Mar 2017 22:48:26 +0900 |
parents | 82350f7fa56c |
children | a7c687c35119 |
line wrap: on
line diff
--- a/tests/test-doctest.py Wed Mar 08 22:13:32 2017 +0900 +++ b/tests/test-doctest.py Wed Mar 08 22:48:26 2017 +0900 @@ -34,6 +34,7 @@ testmod('mercurial.patch') testmod('mercurial.pathutil') testmod('mercurial.parser') +testmod('mercurial.pycompat', py3=True) testmod('mercurial.revsetlang') testmod('mercurial.smartset') testmod('mercurial.store')