From ef6573e52946c70778e29e3b33d61a8a0c6e4052 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Fri, 11 Jul 2003 04:09:55 +0000 Subject: [PATCH] __setitem__: Use integer division for computing # of blocks. --- Lib/dumbdbm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/dumbdbm.py b/Lib/dumbdbm.py index 2f6bc51dd9..b932f84f90 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 -- 2.50.0