mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Use 'l' as format, not 'i'.
This commit is contained in:
parent
fa83c7b31b
commit
3346b6ad49
1 changed files with 2 additions and 2 deletions
|
|
@ -92,11 +92,11 @@ class Unpacker:
|
||||||
# as a nonnegative Python int
|
# as a nonnegative Python int
|
||||||
if x < 0x80000000L: x = int(x)
|
if x < 0x80000000L: x = int(x)
|
||||||
return x
|
return x
|
||||||
if struct.unpack('i', '\0\0\0\1') == 1:
|
if struct.unpack('l', '\0\0\0\1') == 1:
|
||||||
def unpack_uint(self):
|
def unpack_uint(self):
|
||||||
i = self.pos
|
i = self.pos
|
||||||
self.pos = j = i+4
|
self.pos = j = i+4
|
||||||
return struct.unpack('i', self.buf[i:j])
|
return struct.unpack('l', self.buf[i:j])
|
||||||
|
|
||||||
def unpack_int(self):
|
def unpack_int(self):
|
||||||
x = self.unpack_uint()
|
x = self.unpack_uint()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue