simg_dump.py: fix error for CHUNK_TYPE_FILL In python3, division of two integers produces a float, which cannot be used to multiply a bytes sequence. Using // to produce an integer quotient. Bug: 245257511 Test: ./system/core/libsparse/simg_dump.py -sv path/to/image Change-Id: Ibe95056409ac3676a68f5e7693331ca4a66e9fb7
diff --git a/libsparse/simg_dump.py b/libsparse/simg_dump.py index 8811a52..47537ca 100755 --- a/libsparse/simg_dump.py +++ b/libsparse/simg_dump.py
@@ -158,7 +158,7 @@ curtype = format("Fill with 0x%08X" % (fill)) if showhash: h = hashlib.sha1() - data = fill_bin * (blk_sz / 4); + data = fill_bin * (blk_sz // 4); for block in range(chunk_sz): h.update(data) curhash = h.hexdigest()