Fix typical truedivision problem (using the result of division as an index.)

This commit is contained in:
Thomas Wouters 2006-04-20 22:36:57 +00:00
parent a48a3b42dd
commit 4f564bd68a
1 changed files with 2 additions and 2 deletions

View File

@ -80,7 +80,7 @@ class Packer:
if n < 0:
raise ValueError, 'fstring size must be nonnegative'
data = s[:n]
n = ((n+3)/4)*4
n = ((n+3)//4)*4
data = data + (n - len(data)) * '\0'
self.__buf.write(data)
@ -192,7 +192,7 @@ class Unpacker:
if n < 0:
raise ValueError, 'fstring size must be nonnegative'
i = self.__pos
j = i + (n+3)/4*4
j = i + (n+3)//4*4
if j > len(self.__buf):
raise EOFError
self.__pos = j