save_int(): Fixed two new off-by-1 glitches.
This commit is contained in:
parent
e0b904232f
commit
8fda7bc48d
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue