From 8e42a0a0e0358c2004c33e0c7415ca48874df991 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 8 Nov 2007 18:04:45 +0000 Subject: Fixed bug #1081: file.seek allows float arguments --- Lib/io.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Lib/io.py') diff --git a/Lib/io.py b/Lib/io.py index c2f5d3ebfa..d9550ae54a 100644 --- a/Lib/io.py +++ b/Lib/io.py @@ -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: -- cgit v1.2.1