File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -68,14 +68,14 @@ def _createLastWordMask(self):
6868 b = bytearray (struct .pack ("<I" , self ._lastWordMask ))
6969 b [3 ] = mask
7070
71- self ._lastWordMask = struct .unpack ("<I" , b )[0 ]
71+ self ._lastWordMask = struct .unpack ("<I" , bytes ( b ) )[0 ]
7272
7373 def bits_set (self ):
7474 res = 0
7575 for i in range (0 , int (len (self ._bitmap ) / 4 ) - 1 ):
76- res += self ._countBitsUint32 (struct .unpack ("<I" , self ._bitmap [i * 4 :i * 4 + 4 ])[0 ])
76+ res += self ._countBitsUint32 (struct .unpack ("<I" , bytes ( self ._bitmap [i * 4 :i * 4 + 4 ]) )[0 ])
7777
78- res += self ._countBitsUint32 (struct .unpack ("<I" , self ._bitmap [- 4 :])[0 ] & ~ self ._lastWordMask )
78+ res += self ._countBitsUint32 (struct .unpack ("<I" , bytes ( self ._bitmap [- 4 :]) )[0 ] & ~ self ._lastWordMask )
7979
8080 return res
8181
You can’t perform that action at this time.
0 commit comments