changeset 38328:aa9dd805234d

py3: fix loop over byte string in wireprotov1peer Before, it would always return [True]s on Python 3 because list(b"0") == [48].
author Yuya Nishihara <yuya@tcha.org>
date Sat, 16 Jun 2018 17:36:44 +0900
parents 62376d7b8859
children f47608575c10
files contrib/python3-whitelist mercurial/wireprotov1peer.py
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/python3-whitelist	Sat Jun 16 17:04:03 2018 +0900
+++ b/contrib/python3-whitelist	Sat Jun 16 17:36:44 2018 +0900
@@ -205,6 +205,7 @@
 test-imports-checker.t
 test-incoming-outgoing.t
 test-inherit-mode.t
+test-init.t
 test-issue1089.t
 test-issue1102.t
 test-issue1175.t
@@ -227,6 +228,7 @@
 test-journal-exists.t
 test-journal-share.t
 test-journal.t
+test-known.t
 test-largefiles-cache.t
 test-largefiles-misc.t
 test-largefiles-small-disk.t
@@ -450,9 +452,11 @@
 test-sparse-verbose-json.t
 test-sparse.t
 test-split.t
+test-ssh-bundle1.t
 test-ssh-clone-r.t
 test-ssh-proto-unbundle.t
 test-ssh-proto.t
+test-ssh.t
 test-sshserver.py
 test-stack.t
 test-status-inprocess.py
--- a/mercurial/wireprotov1peer.py	Sat Jun 16 17:04:03 2018 +0900
+++ b/mercurial/wireprotov1peer.py	Sat Jun 16 17:36:44 2018 +0900
@@ -355,7 +355,7 @@
         yield {'nodes': wireprototypes.encodelist(nodes)}, f
         d = f.value
         try:
-            yield [bool(int(b)) for b in d]
+            yield [bool(int(b)) for b in pycompat.iterbytestr(d)]
         except ValueError:
             self._abort(error.ResponseError(_("unexpected response:"), d))