# HG changeset patch # User Gregory Szorc # Date 2022-03-02 04:53:52 # Node ID bce8f66d3045c116f6f93b436e8137ef0ccf2e30 # Parent fd5b8e696b75d0f9db748c48b6e2e8d81ea1d880 cborutil: remove Python 2 definition of _elementtointeger() Differential Revision: https://phab.mercurial-scm.org/D12348 diff --git a/mercurial/utils/cborutil.py b/mercurial/utils/cborutil.py --- a/mercurial/utils/cborutil.py +++ b/mercurial/utils/cborutil.py @@ -7,7 +7,6 @@ import struct -import sys # Very short very of RFC 7049... @@ -246,16 +245,8 @@ class CBORDecodeError(Exception): """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')