Mercurial > hg-stable
changeset 49033:bce8f66d3045
cborutil: remove Python 2 definition of _elementtointeger()
Differential Revision: https://phab.mercurial-scm.org/D12348
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 01 Mar 2022 20:53:52 -0800 |
parents | fd5b8e696b75 |
children | 70df51a2c2ce |
files | mercurial/utils/cborutil.py |
diffstat | 1 files changed, 2 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- 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')