From 2a07f529ed7966249303f89413d383438376dbfc Mon Sep 17 00:00:00 2001 From: akun <6awkun@gmail.com> Date: Wed, 7 Mar 2018 17:24:13 +0800 Subject: [PATCH] Refactoring for use `MAX_INT` --- lib/core/bigarray.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/bigarray.py b/lib/core/bigarray.py index c7b2a6198..929d7f12e 100644 --- a/lib/core/bigarray.py +++ b/lib/core/bigarray.py @@ -20,6 +20,7 @@ from lib.core.enums import MKSTEMP_PREFIX from lib.core.exception import SqlmapSystemException from lib.core.settings import BIGARRAY_CHUNK_SIZE from lib.core.settings import BIGARRAY_COMPRESS_LEVEL +from lib.core.settings import MAX_INT DEFAULT_SIZE_OF = sys.getsizeof(object()) @@ -54,7 +55,7 @@ class BigArray(list): def __init__(self, items=[]): self.chunks = [[]] - self.chunk_length = sys.maxsize + self.chunk_length = MAX_INT self.cache = None self.filenames = set() self._os_remove = os.remove @@ -66,7 +67,7 @@ class BigArray(list): def append(self, value): self.chunks[-1].append(value) - if self.chunk_length == sys.maxsize: + if self.chunk_length == MAX_INT: self._size_counter += _size_of(value) if self._size_counter >= BIGARRAY_CHUNK_SIZE: self.chunk_length = len(self.chunks[-1])