From 9fc9d66d852278f6106f3057bf4317b9b3158fab Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Tue, 1 Aug 2017 21:25:39 +0200 Subject: fix issue #144: integer overflow on 2.7 (reported by ccatterina) I added a test loading 9223372036854775808 as sys.maxint on my development system is larger than the problematic value reported (on Raspberry Pi) If this change solves the issue then please change the status to closed. --- scalarint.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scalarint.py') diff --git a/scalarint.py b/scalarint.py index 9f17b0c..d609236 100644 --- a/scalarint.py +++ b/scalarint.py @@ -7,13 +7,15 @@ if False: # MYPY __all__ = ["ScalarInt", "BinaryInt", "OctalInt", "HexInt", "HexCapsInt"] +from .compat import no_limit_int # NOQA -class ScalarInt(int): + +class ScalarInt(no_limit_int): def __new__(cls, *args, **kw): # type: (Any, Any, Any) -> Any width = kw.pop('width', None) # type: ignore underscore = kw.pop('underscore', None) # type: ignore - v = int.__new__(cls, *args, **kw) # type: ignore + v = no_limit_int.__new__(cls, *args, **kw) # type: ignore v._width = width v._underscore = underscore return v -- cgit v1.2.1