summaryrefslogtreecommitdiffstats
path: root/Lib/dumbdbm.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-07-11 04:09:55 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-07-11 04:09:55 (GMT)
commitef6573e52946c70778e29e3b33d61a8a0c6e4052 (patch)
tree12da3b8461fa6f49bd7125070e3b24fdecd7d7ea /Lib/dumbdbm.py
parent663d1b61cb1a69671dc5b831681d416e4b76a72d (diff)
downloadcpython-ef6573e52946c70778e29e3b33d61a8a0c6e4052.zip
cpython-ef6573e52946c70778e29e3b33d61a8a0c6e4052.tar.gz
cpython-ef6573e52946c70778e29e3b33d61a8a0c6e4052.tar.bz2
__setitem__: Use integer division for computing # of blocks.
Diffstat (limited to 'Lib/dumbdbm.py')
-rw-r--r--Lib/dumbdbm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/dumbdbm.py b/Lib/dumbdbm.py
index 2f6bc51..b932f84 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