Test if queue batch is boolean
In Python bool type is a subtype of integer so it must be tested first. Also by converting other types to int, we catch any other wrong types. Closes #13133
This commit is contained in:
@@ -248,10 +248,10 @@ class _Method(object):
|
||||
|
||||
if isinstance(instances, list):
|
||||
if has_worker and queue_batch:
|
||||
if isinstance(queue_batch, int):
|
||||
count = queue_batch
|
||||
else:
|
||||
if isinstance(queue_batch, bool):
|
||||
count = batch_size
|
||||
else:
|
||||
count = int(queue_batch)
|
||||
else:
|
||||
count = len(instances)
|
||||
task_ids = []
|
||||
|
||||
Reference in New Issue
Block a user