diff -r fd5b8e696b75 -r bce8f66d3045 mercurial/utils/cborutil.py --- a/mercurial/utils/cborutil.py Mon Feb 21 12:42:48 2022 -0700 +++ b/mercurial/utils/cborutil.py Tue Mar 01 20:53:52 2022 -0800 @@ -7,7 +7,6 @@ import struct -import sys # Very short very of RFC 7049... @@ -246,16 +245,8 @@ """Represents an error decoding CBOR.""" -if sys.version_info.major >= 3: - - def _elementtointeger(b, i): - return b[i] - - -else: - - def _elementtointeger(b, i): - return ord(b[i]) +def _elementtointeger(b, i): + return b[i] STRUCT_BIG_UBYTE = struct.Struct('>B')