diff --git a/.travis.yml b/.travis.yml index 8b87bef..844b60c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ matrix: env: TOXENV=py35 - python: 3.6 env: TOXENV=py36 - - python: pypy2.7 + - python: pypy env: TOXENV=pypy - python: pypy3.5 env: TOXENV=pypy3 diff --git a/logzio/sender.py b/logzio/sender.py index 7b51d53..64cc4bd 100644 --- a/logzio/sender.py +++ b/logzio/sender.py @@ -156,7 +156,12 @@ class LogzioSender: current_size = 0 while not self.queue.empty(): current_log = self.queue.get() - current_size += sys.getsizeof(current_log) + try: + current_size += sys.getsizeof(current_log) + except TypeError: + # pypy do not support sys.getsizeof + current_size += len(current_log) * 4 + logs_list.append(current_log) if current_size >= MAX_BULK_SIZE_IN_BYTES: break