Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4f564bd

Browse files
committed
Fix typical truedivision problem (using the result of division as an index.)
1 parent a48a3b4 commit 4f564bd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/xdrlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def pack_fstring(self, n, s):
8080
if n < 0:
8181
raise ValueError, 'fstring size must be nonnegative'
8282
data = s[:n]
83-
n = ((n+3)/4)*4
83+
n = ((n+3)//4)*4
8484
data = data + (n - len(data)) * '\0'
8585
self.__buf.write(data)
8686

@@ -192,7 +192,7 @@ def unpack_fstring(self, n):
192192
if n < 0:
193193
raise ValueError, 'fstring size must be nonnegative'
194194
i = self.__pos
195-
j = i + (n+3)/4*4
195+
j = i + (n+3)//4*4
196196
if j > len(self.__buf):
197197
raise EOFError
198198
self.__pos = j

0 commit comments

Comments
 (0)