1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

target/HexInt: Fix to inherit from long instead of int.

When using Python 2.7 `int`s have a maximum size which can be exceeded
when attempting to convert the hex representation back. Change `HexInt` to
be a `long` instead to avoid this issue.
This commit is contained in:
Marc Bonnici 2019-02-13 14:16:55 +00:00 committed by setrofim
parent 2e81a72b39
commit 1417e81605

View File

@ -1792,7 +1792,7 @@ class KernelVersion(object):
__repr__ = __str__
class HexInt(int):
class HexInt(long):
"""
Subclass of :class:`int` that uses hexadecimal formatting by default.
"""
@ -1805,7 +1805,7 @@ class HexInt(int):
return super_new(cls, val, base=base)
def __str__(self):
return hex(self)
return hex(self).strip('L')
class KernelConfigTristate(Enum):