[pypy-svn] r54785 - pypy/dist/pypy/rpython/module

afa at codespeak.net afa at codespeak.net
Fri May 16 12:05:07 CEST 2008


Author: afa
Date: Fri May 16 12:05:05 2008
New Revision: 54785

Modified:
   pypy/dist/pypy/rpython/module/ll_os.py
Log:
test_ll_os passes on win32.


Modified: pypy/dist/pypy/rpython/module/ll_os.py
==============================================================================
--- pypy/dist/pypy/rpython/module/ll_os.py	(original)
+++ pypy/dist/pypy/rpython/module/ll_os.py	Fri May 16 12:05:05 2008
@@ -613,9 +613,16 @@
                                     [rffi.CCHARP, rffi.INT],
                                     rffi.INT)
 
-        def access_llimpl(path, mode):
-            error = rffi.cast(lltype.Signed, os_access(path, mode))
-            return error == 0
+        if sys.platform.startswith('win'):
+            # All files are executable on Windows
+            def access_llimpl(path, mode):
+                mode = mode & ~os.X_OK
+                error = rffi.cast(lltype.Signed, os_access(path, mode))
+                return error == 0
+        else:
+            def access_llimpl(path, mode):
+                error = rffi.cast(lltype.Signed, os_access(path, mode))
+                return error == 0
 
         def os_access_oofakeimpl(path, mode):
             return os.access(OOSupport.from_rstr(path), mode)



More information about the Pypy-commit mailing list