From: Tim Peters Date: Fri, 11 Jul 2003 04:09:55 +0000 (+0000) Subject: __setitem__: Use integer division for computing # of blocks. X-Git-Tag: v2.3c1~126 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef6573e52946c70778e29e3b33d61a8a0c6e4052;p=thirdparty%2FPython%2Fcpython.git __setitem__: Use integer division for computing # of blocks. --- diff --git a/Lib/dumbdbm.py b/Lib/dumbdbm.py index 2f6bc51dd915..b932f84f9063 100644 --- a/Lib/dumbdbm.py +++ b/Lib/dumbdbm.py @@ -114,8 +114,8 @@ class _Database(UserDict.DictMixin): self._addkey(key, (pos, siz)) else: pos, siz = self._index[key] - oldblocks = (siz + _BLOCKSIZE - 1) / _BLOCKSIZE - newblocks = (len(val) + _BLOCKSIZE - 1) / _BLOCKSIZE + oldblocks = (siz + _BLOCKSIZE - 1) // _BLOCKSIZE + newblocks = (len(val) + _BLOCKSIZE - 1) // _BLOCKSIZE if newblocks <= oldblocks: pos, siz = self._setval(pos, val) self._index[key] = pos, siz