From 8130f7c3c4a5fa8458bd1dd7ee40229ee687952e Mon Sep 17 00:00:00 2001 From: Alexandre Vassalotti Date: Thu, 8 May 2008 01:39:38 +0000 Subject: [PATCH] Fixed the negative value check in io._BytesIO.seek(). --- Lib/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/io.py b/Lib/io.py index 940c4c776c8..d85ed49d150 100644 --- a/Lib/io.py +++ b/Lib/io.py @@ -831,9 +831,9 @@ class _BytesIO(BufferedIOBase): except AttributeError as err: raise TypeError("an integer is required") from err if whence == 0: - self._pos = max(0, pos) if pos < 0: raise ValueError("negative seek position %r" % (pos,)) + self._pos = max(0, pos) elif whence == 1: self._pos = max(0, self._pos + pos) elif whence == 2: