[Python-checkins] python/dist/src/Lib dumbdbm.py,1.21,1.22

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Thu, 10 Jul 2003 21:09:57 -0700


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

Modified Files:
	dumbdbm.py 
Log Message:
__setitem__:  Use integer division for computing # of blocks.


Index: dumbdbm.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/dumbdbm.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** dumbdbm.py	28 Jun 2003 07:08:39 -0000	1.21
--- dumbdbm.py	11 Jul 2003 04:09:55 -0000	1.22
***************
*** 115,120 ****
          else:
              pos, siz = self._index[key]
!             oldblocks = (siz + _BLOCKSIZE - 1) / _BLOCKSIZE
!             newblocks = (len(val) + _BLOCKSIZE - 1) / _BLOCKSIZE
              if newblocks <= oldblocks:
                  pos, siz = self._setval(pos, val)
--- 115,120 ----
          else:
              pos, siz = self._index[key]
!             oldblocks = (siz + _BLOCKSIZE - 1) // _BLOCKSIZE
!             newblocks = (len(val) + _BLOCKSIZE - 1) // _BLOCKSIZE
              if newblocks <= oldblocks:
                  pos, siz = self._setval(pos, val)