[Python-checkins] python/dist/src/Lib pickle.py,1.97,1.98

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Mon, 27 Jan 2003 19:40:54 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv19264/Lib

Modified Files:
	pickle.py 
Log Message:
save_int():  Fixed two new off-by-1 glitches.


Index: pickle.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v
retrieving revision 1.97
retrieving revision 1.98
diff -C2 -d -r1.97 -r1.98
*** pickle.py	28 Jan 2003 03:17:21 -0000	1.97
--- pickle.py	28 Jan 2003 03:40:52 -0000	1.98
***************
*** 369,376 ****
              # First one- and two-byte unsigned ints:
              if object >= 0:
!                 if object < 0xff:
                      self.write(BININT1 + chr(object))
                      return
!                 if object < 0xffff:
                      self.write(BININT2 + chr(object&0xff) + chr(object>>8))
                      return
--- 369,376 ----
              # First one- and two-byte unsigned ints:
              if object >= 0:
!                 if object <= 0xff:
                      self.write(BININT1 + chr(object))
                      return
!                 if object <= 0xffff:
                      self.write(BININT2 + chr(object&0xff) + chr(object>>8))
                      return