From 1417e816052a70d59b0f5492d38c9db454c2eae1 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Wed, 13 Feb 2019 14:16:55 +0000 Subject: [PATCH] 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. --- devlib/target.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devlib/target.py b/devlib/target.py index 18fb59c..28b10a2 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -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):