diff mercurial/wireprotov1peer.py @ 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 856f381ad74b
children e7aa113b14f7
line wrap: on
line diff
--- 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))