# HG changeset patch # User Augie Fackler # Date 2019-01-16 16:01:45 # Node ID d08c816a11d3ce4478958261976e6439c03e1e88 # Parent ebda5d4265ec759df04c1b95ce3bc128063d6c8b shallowutil: slice off a byte instead of subscripting This behaves identically on Python 2 and 3. Differential Revision: https://phab.mercurial-scm.org/D5607 diff --git a/hgext/remotefilelog/shallowutil.py b/hgext/remotefilelog/shallowutil.py --- a/hgext/remotefilelog/shallowutil.py +++ b/hgext/remotefilelog/shallowutil.py @@ -121,7 +121,7 @@ def _parsepackmeta(metabuf): 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