changeset 34215:b4abc438a8c9

py3: iterate bytes as a byte string in store.lowerencode()
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 17:28:47 +0900
parents 7e3f078b6f31
children 1c601df9894c
files mercurial/store.py tests/test-doctest.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/store.py	Sun Sep 03 17:27:50 2017 +0900
+++ b/mercurial/store.py	Sun Sep 03 17:28:47 2017 +0900
@@ -164,7 +164,7 @@
     for x in range(ord("A"), ord("Z") + 1):
         cmap[xchr(x)] = xchr(x).lower()
     def lowerencode(s):
-        return "".join([cmap[c] for c in s])
+        return "".join([cmap[c] for c in pycompat.iterbytestr(s)])
     return lowerencode
 
 lowerencode = getattr(parsers, 'lowerencode', None) or _buildlowerencodefun()
--- a/tests/test-doctest.py	Sun Sep 03 17:27:50 2017 +0900
+++ b/tests/test-doctest.py	Sun Sep 03 17:28:47 2017 +0900
@@ -63,7 +63,7 @@
 testmod('mercurial.pycompat')
 testmod('mercurial.revsetlang')
 testmod('mercurial.smartset')
-testmod('mercurial.store', py3=False)  # py3: bytes[n]
+testmod('mercurial.store')
 testmod('mercurial.subrepo')
 testmod('mercurial.templatefilters')
 testmod('mercurial.templater')