changeset 34212:dfd009e5f9f2

py3: iterate bytes as a byte string in dagparser.py
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 15:32:45 +0900
parents a48ad118c558
children 96808804b68f
files mercurial/dagparser.py tests/test-doctest.py
diffstat 2 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dagparser.py	Sun Sep 03 15:28:39 2017 +0900
+++ b/mercurial/dagparser.py	Sun Sep 03 15:32:45 2017 +0900
@@ -181,7 +181,7 @@
         else:
             return labels[ref]
 
-    chiter = (c for c in desc)
+    chiter = pycompat.iterbytestr(desc)
 
     def nextch():
         return next(chiter, '\0')
--- a/tests/test-doctest.py	Sun Sep 03 15:28:39 2017 +0900
+++ b/tests/test-doctest.py	Sun Sep 03 15:32:45 2017 +0900
@@ -48,8 +48,7 @@
 testmod('mercurial.color')
 testmod('mercurial.config')
 testmod('mercurial.context')
-testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE,
-        py3=False)  # py3: use of str()
+testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE)
 testmod('mercurial.dispatch')
 testmod('mercurial.encoding', py3=False)  # py3: multiple encoding issues
 testmod('mercurial.formatter', py3=False)  # py3: write bytes to stdout