# HG changeset patch # User Gregory Szorc # Date 2019-01-25 23:03:20 # Node ID e6c1c6478d04896e8ce12dca0c34ab02784a5da7 # Parent e053053ceba771176244e127c7100bba392d1808 wireprotov2peer: rewrite character traversal to use slices Otherwise on Python 3 we iterate over integers instead of a bytes instance and the comparison fails. Differential Revision: https://phab.mercurial-scm.org/D5698 diff --git a/mercurial/wireprotov2peer.py b/mercurial/wireprotov2peer.py --- a/mercurial/wireprotov2peer.py +++ b/mercurial/wireprotov2peer.py @@ -510,7 +510,7 @@ def decodeknown(objs): # Bytestring where each byte is a 0 or 1. raw = next(objs) - return [True if c == '1' else False for c in raw] + return [True if raw[i:i + 1] == b'1' else False for i in range(len(raw))] def decodelistkeys(objs): # Map with bytestring keys and values.