]> granicus.if.org Git - python/commitdiff
Cast f.tell() result to int() in _addval(), so it works even on
authorGuido van Rossum <guido@python.org>
Tue, 27 Apr 1999 12:21:17 +0000 (12:21 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 27 Apr 1999 12:21:17 +0000 (12:21 +0000)
platforms where tell() returns a long.  (Perhaps tell() should be
fixed too?)  Reported by Greg Humphreys.

Lib/dumbdbm.py

index 0ae1e82fad41f31a07c9c6d08878f00365528d56..200bc7feec257db1c99bb705f047ac2685b0fe92 100644 (file)
@@ -79,7 +79,7 @@ class _Database:
        def _addval(self, val):
                f = _open(self._datfile, 'rb+')
                f.seek(0, 2)
-               pos = f.tell()
+               pos = int(f.tell())
 ## Does not work under MW compiler
 ##             pos = ((pos + _BLOCKSIZE - 1) / _BLOCKSIZE) * _BLOCKSIZE
 ##             f.seek(pos)