summaryrefslogtreecommitdiff
path: root/scalarint.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-08-01 21:25:39 +0200
committerAnthon van der Neut <anthon@mnt.org>2017-08-01 21:25:39 +0200
commit9fc9d66d852278f6106f3057bf4317b9b3158fab (patch)
tree887ed2390c9d6c8272bede43af5d08df3b3d07d1 /scalarint.py
parentc578a31b464e7dbabe521010937b28b657d9ca2b (diff)
downloadruamel.yaml-9fc9d66d852278f6106f3057bf4317b9b3158fab.tar.gz
fix issue #144: integer overflow on 2.7 (reported by ccatterina)0.15.23
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.
Diffstat (limited to 'scalarint.py')
-rw-r--r--scalarint.py6
1 files changed, 4 insertions, 2 deletions
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