From: Guido van Rossum Date: Tue, 27 Apr 1999 12:21:17 +0000 (+0000) Subject: Cast f.tell() result to int() in _addval(), so it works even on X-Git-Tag: v1.6a1~1452 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f36a085feeba6217f791d683021816fa513c01f;p=python Cast f.tell() result to int() in _addval(), so it works even on platforms where tell() returns a long. (Perhaps tell() should be fixed too?) Reported by Greg Humphreys. --- diff --git a/Lib/dumbdbm.py b/Lib/dumbdbm.py index 0ae1e82fad..200bc7feec 100644 --- a/Lib/dumbdbm.py +++ b/Lib/dumbdbm.py @@ -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)