cborutil: remove Python 2 definition of _elementtointeger()
Differential Revision: https://phab.mercurial-scm.org/D12348
--- 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')