Fixed bug #1081: file.seek allows float arguments

This commit is contained in:
Christian Heimes 2007-11-08 18:04:45 +00:00
parent 8bd14fb398
commit 8e42a0a0e0
3 changed files with 10 additions and 0 deletions

View file

@ -694,6 +694,8 @@ class BytesIO(BufferedIOBase):
return n
def seek(self, pos, whence=0):
if not isinstance(pos, int):
raise TypeError("an integer is required")
if whence == 0:
self._pos = max(0, pos)
elif whence == 1: