]> granicus.if.org Git - python/commitdiff
Make xdrlib use floor division instead of classic division.
authorGeorg Brandl <georg@python.org>
Tue, 28 Mar 2006 10:07:46 +0000 (10:07 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 28 Mar 2006 10:07:46 +0000 (10:07 +0000)
Makes test_xdrlib pass.

Lib/xdrlib.py

index 47cc22b2e6ca9f2a3bdbc228feff0a9fda00d72a..b349eb9b7949944ca66d4e3f7f54a2ac8548473e 100644 (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