From: Tim Peters Date: Tue, 28 Jan 2003 03:40:52 +0000 (+0000) Subject: save_int(): Fixed two new off-by-1 glitches. X-Git-Tag: v2.3c1~2253 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8fda7bc48d7f58983ff54bf11367ed936767cd72;p=thirdparty%2FPython%2Fcpython.git save_int(): Fixed two new off-by-1 glitches. --- diff --git a/Lib/pickle.py b/Lib/pickle.py index cb27f8ab859a..ab5fcb6113b3 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -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: