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:
Cédric Krier
2024-04-13 14:20:21 +02:00
parent 1f2b9e15c3
commit dda35caa21
+3 -3
View File
@@ -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 = []