aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2018-06-21 15:25:14 -0400
committerBryn M. Reeves <bmr@redhat.com>2018-06-21 20:31:32 +0100
commit6d09c48c1faa4e08d53c57124c19fa3c8ec9e8bd (patch)
treed09df877561e3ddad8320c2a089dfb6f02b24187
parent4aae08aee6b1f49b5fe5a76079f1cae9a75b9b6b (diff)
downloadsos-6d09c48c1faa4e08d53c57124c19fa3c8ec9e8bd.tar.gz
[utilities] Ensure slots in deque is always integer
With python3, the 'slots' calculation returns a decimal number which deque() will not accept, thus throwing an exception. Always make sure slots is an integer value. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/utilities.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/utilities.py b/sos/utilities.py
index 7c749aec..42dceff6 100644
--- a/sos/utilities.py
+++ b/sos/utilities.py
@@ -209,7 +209,7 @@ class AsyncReader(threading.Thread):
slots = None
if sizelimit:
sizelimit = sizelimit * 1048576 # convert to bytes
- slots = sizelimit / self.chunksize
+ slots = int(sizelimit / self.chunksize)
self.deque = deque(maxlen=slots)
self.start()
self.join()