[Python-3000-checkins] r62845 - python/branches/py3k/Lib/io.py

alexandre.vassalotti python-3000-checkins at python.org
Thu May 8 03:39:39 CEST 2008


Author: alexandre.vassalotti
Date: Thu May  8 03:39:38 2008
New Revision: 62845

Log:
Fixed the negative value check in io._BytesIO.seek().


Modified:
   python/branches/py3k/Lib/io.py

Modified: python/branches/py3k/Lib/io.py
==============================================================================
--- python/branches/py3k/Lib/io.py	(original)
+++ python/branches/py3k/Lib/io.py	Thu May  8 03:39:38 2008
@@ -831,9 +831,9 @@
         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:


More information about the Python-3000-checkins mailing list