[pypy-svn] r34196 - in pypy/branch/refactor-file/pypy/module/posix: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Sat Nov 4 17:27:06 CET 2006


Author: cfbolz
Date: Sat Nov  4 17:27:05 2006
New Revision: 34196

Modified:
   pypy/branch/refactor-file/pypy/module/posix/app_posix.py
   pypy/branch/refactor-file/pypy/module/posix/test/test_posix2.py
Log:
(guido, cfbolz): fix the default for buffering. fix test that checked that
fdopen does not work (!).


Modified: pypy/branch/refactor-file/pypy/module/posix/app_posix.py
==============================================================================
--- pypy/branch/refactor-file/pypy/module/posix/app_posix.py	(original)
+++ pypy/branch/refactor-file/pypy/module/posix/app_posix.py	Sat Nov  4 17:27:05 2006
@@ -23,7 +23,7 @@
     st_mtime = tuple_item_getter(8)
     st_ctime = tuple_item_getter(9)
 
-def fdopen(fd, mode='r', buffering=None):
+def fdopen(fd, mode='r', buffering=-1):
     """fdopen(fd [, mode='r' [, buffering]]) -> file_object
 
     Return an open file object connected to a file descriptor."""

Modified: pypy/branch/refactor-file/pypy/module/posix/test/test_posix2.py
==============================================================================
--- pypy/branch/refactor-file/pypy/module/posix/test/test_posix2.py	(original)
+++ pypy/branch/refactor-file/pypy/module/posix/test/test_posix2.py	Sat Nov  4 17:27:05 2006
@@ -72,15 +72,11 @@
         ex(self.posix.dup, UNUSEDFD)
 
     def test_fdopen(self):
-        path = self.path 
-        posix = self.posix 
+        path = self.path
+        posix = self.posix
         fd = posix.open(path, posix.O_RDONLY, 0777)
-        try:
-            f = posix.fdopen(fd, "r")
-        except NotImplementedError:
-            pass
-        else:
-            raise "did not raise"
+        f = posix.fdopen(fd, "r")
+        f.close()
 
     def test_listdir(self):
         pdir = self.pdir



More information about the Pypy-commit mailing list