mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
#687648 from Robert Schuppenies: use classic division.
This commit is contained in:
parent
e91fcbdf69
commit
2a9b9cbea0
12 changed files with 33 additions and 33 deletions
|
|
@ -57,7 +57,7 @@ class Packer:
|
|||
def pack_fstring(self, n, s):
|
||||
if n < 0:
|
||||
raise ValueError, 'fstring size must be nonnegative'
|
||||
n = ((n+3)/4)*4
|
||||
n = ((n + 3)//4)*4
|
||||
data = s[:n]
|
||||
data = data + (n - len(data)) * '\0'
|
||||
self.buf = self.buf + data
|
||||
|
|
@ -164,7 +164,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue