From 5f06463c6c23f337147457dd9e490887ac194db4 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Wed, 4 May 2016 16:06:24 +0300 Subject: wic: 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. [YOCTO #9412] (From OE-Core rev: 997ff239bd753a7957cc14c6829b2f093d9bcef6) Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- scripts/lib/wic/utils/partitionedfs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/lib/wic/utils/partitionedfs.py') diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index 8f4db4e17d..46b5d345c7 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -95,7 +95,7 @@ class Image(): ks_pnum = len(self.partitions) # Converting kB to sectors for parted - size = size * 1024 / self.sector_size + size = size * 1024 // self.sector_size part = {'ks_pnum': ks_pnum, # Partition number in the KS file 'size': size, # In sectors @@ -173,12 +173,12 @@ class Image(): # gaps we could enlargea the previous partition? # Calc how much the alignment is off. - align_sectors = disk['offset'] % (part['align'] * 1024 / self.sector_size) + align_sectors = disk['offset'] % (part['align'] * 1024 // self.sector_size) if align_sectors: # If partition is not aligned as required, we need # to move forward to the next alignment point - align_sectors = (part['align'] * 1024 / self.sector_size) - align_sectors + align_sectors = (part['align'] * 1024 // self.sector_size) - align_sectors msger.debug("Realignment for %s%s with %s sectors, original" " offset %s, target alignment is %sK." % -- cgit v1.2.3-54-g00ecf