fix TypeError: argument of type int is not iterable

This commit is contained in:
tanlingyun2005 2019-04-19 16:37:11 +08:00
parent 4859e6c9f0
commit 070ae845de

View file

@ -85,7 +85,7 @@ class Batch(object):
'''
partition = lambda x: float(x) / 100.0 * len(self.minions)
try:
if '%' in self.opts['batch']:
if isinstance(self.opts['batch'], str) and '%' in self.opts['batch']:
res = partition(float(self.opts['batch'].strip('%')))
if res < 1:
return int(math.ceil(res))