summaryrefslogtreecommitdiff
path: root/compat.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 /compat.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 'compat.py')
-rw-r--r--compat.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/compat.py b/compat.py
index 7fffedf..6b05d5a 100644
--- a/compat.py
+++ b/compat.py
@@ -81,6 +81,8 @@ if PY3:
import io
StringIO = io.StringIO
BytesIO = io.BytesIO
+ # have unlimited precision
+ no_limit_int = int
else:
string_types = basestring # NOQA
@@ -95,6 +97,8 @@ else:
StringIO = _StringIO
import cStringIO
BytesIO = cStringIO.StringIO
+ # have unlimited precision
+ no_limit_int = long # NOQA not available on Python 3
if False: # MYPY
# StreamType = Union[BinaryIO, IO[str], IO[unicode], StringIO]