mirror of
https://git.yoctoproject.org/poky
synced 2026-04-23 00:32:12 +02:00
bitbake: toaster: use // operator instead of /
Division operator works differently in Python 3. It results in float unlike in Python 2, where it results in int. Explicitly used "floor division" operator instead of 'division' operator. This should make the code to result in integer under both pythons. (Bitbake rev: 0c38441ed99b49dae8ef9613e320f0760853d6aa) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
9434eee39a
commit
ce9cff5b28
@@ -424,7 +424,7 @@ class Build(models.Model):
|
||||
tf = Task.objects.filter(build = self)
|
||||
tfc = tf.count()
|
||||
if tfc > 0:
|
||||
completeper = tf.exclude(order__isnull=True).count()*100/tfc
|
||||
completeper = tf.exclude(order__isnull=True).count()*100 // tfc
|
||||
else:
|
||||
completeper = 0
|
||||
return completeper
|
||||
|
||||
@@ -90,7 +90,7 @@ def whitespace_space_filter(value, arg):
|
||||
def divide(value, arg):
|
||||
if int(arg) == 0:
|
||||
return -1
|
||||
return int(value) / int(arg)
|
||||
return int(value) // int(arg)
|
||||
|
||||
@register.filter
|
||||
def multiply(value, arg):
|
||||
|
||||
Reference in New Issue
Block a user