[pypy-svn] r78442 - in pypy/branch/fast-forward/pypy/module/_io: . test

afa at codespeak.net afa at codespeak.net
Fri Oct 29 10:16:24 CEST 2010


Author: afa
Date: Fri Oct 29 10:16:23 2010
New Revision: 78442

Modified:
   pypy/branch/fast-forward/pypy/module/_io/interp_bytesio.py
   pypy/branch/fast-forward/pypy/module/_io/test/test_bytesio.py
Log:
Bah. Test and fix


Modified: pypy/branch/fast-forward/pypy/module/_io/interp_bytesio.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/_io/interp_bytesio.py	(original)
+++ pypy/branch/fast-forward/pypy/module/_io/interp_bytesio.py	Fri Oct 29 10:16:23 2010
@@ -100,7 +100,7 @@
             if pos < 0:
                 raise OperationError(space.w_ValueError, space.wrap(
                     "negative seek value"))
-        if whence == 1:
+        elif whence == 1:
             if pos > sys.maxint - self.pos:
                 raise OperationError(space.w_OverflowError, space.wrap(
                     "new position too large"))

Modified: pypy/branch/fast-forward/pypy/module/_io/test/test_bytesio.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/_io/test/test_bytesio.py	(original)
+++ pypy/branch/fast-forward/pypy/module/_io/test/test_bytesio.py	Fri Oct 29 10:16:23 2010
@@ -25,3 +25,4 @@
         assert f.tell() == 0
         assert f.seek(-1, 2) == 4
         assert f.tell() == 4
+        assert f.seek(0) == 0



More information about the Pypy-commit mailing list