mirror of
https://github.com/python/cpython.git
synced 2026-05-22 04:13:22 -04:00
save_int(): Fixed two new off-by-1 glitches.
This commit is contained in:
+2
-2
@@ -368,10 +368,10 @@ class Pickler:
|
||||
# case.
|
||||
# First one- and two-byte unsigned ints:
|
||||
if object >= 0:
|
||||
if object < 0xff:
|
||||
if object <= 0xff:
|
||||
self.write(BININT1 + chr(object))
|
||||
return
|
||||
if object < 0xffff:
|
||||
if object <= 0xffff:
|
||||
self.write(BININT2 + chr(object&0xff) + chr(object>>8))
|
||||
return
|
||||
# Next check for 4-byte signed ints:
|
||||
|
||||
Reference in New Issue
Block a user