shallowutil: slice off a byte instead of subscripting
authorAugie Fackler <augie@google.com>
Wed, 16 Jan 2019 11:01:45 -0500
changeset 41257 d08c816a11d3
parent 41256 ebda5d4265ec
child 41258 a6b98c95bcf0
shallowutil: slice off a byte instead of subscripting This behaves identically on Python 2 and 3. Differential Revision: https://phab.mercurial-scm.org/D5607
hgext/remotefilelog/shallowutil.py
--- a/hgext/remotefilelog/shallowutil.py	Wed Jan 16 11:01:16 2019 -0500
+++ b/hgext/remotefilelog/shallowutil.py	Wed Jan 16 11:01:45 2019 -0500
@@ -121,7 +121,7 @@
     offset = 0
     buflen = len(metabuf)
     while buflen - offset >= 3:
-        key = metabuf[offset]
+        key = metabuf[offset:offset + 1]
         offset += 1
         metalen = struct.unpack_from('!H', metabuf, offset)[0]
         offset += 2