aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-05-30 15:51:20 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-01 15:28:23 +0100
commit0c38441ed99b49dae8ef9613e320f0760853d6aa (patch)
tree8603157e5fe42662189b476cb6d3ebaa00f41560 /lib
parent750ca5c8d5a25fc519b75c56352dec7823c7e240 (diff)
downloadbitbake-0c38441ed99b49dae8ef9613e320f0760853d6aa.tar.gz
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/toaster/orm/models.py2
-rw-r--r--lib/toaster/toastergui/templatetags/projecttags.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index dd6466471..25bc1dbe1 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -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
diff --git a/lib/toaster/toastergui/templatetags/projecttags.py b/lib/toaster/toastergui/templatetags/projecttags.py
index 75f2261be..1d680365a 100644
--- a/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/lib/toaster/toastergui/templatetags/projecttags.py
@@ -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):