Fix TypeError in function chunkify

This patch fixes TypeError of range() in function chunkify, as
range() integer step argument expected, but got str.

Change-Id: I2acde859e014baa4c4c59caa6f4ea938c7c4c3bf
(cherry picked from commit c717be12a6)
This commit is contained in:
LiXiangyu
2017-09-26 17:46:20 +08:00
committed by Li Xiangyu
parent b0ef77f5d1
commit 9af6886b0e

View File

@@ -87,6 +87,7 @@ class WeightPlanner(base.BasePlanner):
@staticmethod
def chunkify(lst, n):
"""Yield successive n-sized chunks from lst."""
n = int(n)
if n < 1:
# Just to make sure the number is valid
n = 1