Kaydet (Commit) 8fda7bc4 authored tarafından Tim Peters's avatar Tim Peters

save_int(): Fixed two new off-by-1 glitches.

üst e0b90423
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment