[pypy-svn] r32516 - in pypy/branch/timeshift-refactoring/pypy/module/mmap: . test

arigo at codespeak.net arigo at codespeak.net
Wed Sep 20 09:52:25 CEST 2006


Author: arigo
Date: Wed Sep 20 09:52:23 2006
New Revision: 32516

Modified:
   pypy/branch/timeshift-refactoring/pypy/module/mmap/interp_mmap.py
   pypy/branch/timeshift-refactoring/pypy/module/mmap/test/test_mmap.py
Log:
The return value of mmap().flush() is not well-defined in CPython either.


Modified: pypy/branch/timeshift-refactoring/pypy/module/mmap/interp_mmap.py
==============================================================================
--- pypy/branch/timeshift-refactoring/pypy/module/mmap/interp_mmap.py	(original)
+++ pypy/branch/timeshift-refactoring/pypy/module/mmap/interp_mmap.py	Wed Sep 20 09:52:23 2006
@@ -427,6 +427,8 @@
             start = self.getptr(offset)
             if _MS_WINDOWS:
                 res = FlushViewOfFile(start, size)
+                # XXX res == 0 means that an error occurred, but in CPython
+                # this is not checked
                 return self.space.wrap(res)
             elif _POSIX:
 ##                XXX why is this code here?  There is no equivalent in CPython

Modified: pypy/branch/timeshift-refactoring/pypy/module/mmap/test/test_mmap.py
==============================================================================
--- pypy/branch/timeshift-refactoring/pypy/module/mmap/test/test_mmap.py	(original)
+++ pypy/branch/timeshift-refactoring/pypy/module/mmap/test/test_mmap.py	Wed Sep 20 09:52:23 2006
@@ -247,7 +247,7 @@
         raises(TypeError, m.flush, 1, 2, 3)
         raises(TypeError, m.flush, 1, "a")
         raises(ValueError, m.flush, 0, 99)
-        assert m.flush() == 0
+        m.flush()    # return value is a bit meaningless, platform-dependent
         m.close()
         f.close()
 



More information about the Pypy-commit mailing list