[Python-checkins] r43394 - python/trunk/Lib/xdrlib.py
georg.brandl
python-checkins at python.org
Tue Mar 28 12:07:46 CEST 2006
Author: georg.brandl
Date: Tue Mar 28 12:07:46 2006
New Revision: 43394
Modified:
python/trunk/Lib/xdrlib.py
Log:
Make xdrlib use floor division instead of classic division.
Makes test_xdrlib pass.
Modified: python/trunk/Lib/xdrlib.py
==============================================================================
--- python/trunk/Lib/xdrlib.py (original)
+++ python/trunk/Lib/xdrlib.py Tue Mar 28 12:07:46 2006
@@ -80,7 +80,7 @@
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 @@
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
More information about the Python-checkins
mailing list