[pypy-svn] r44281 - in pypy/branch/kill-ctypes/pypy/module/posix: . test

fijal at codespeak.net fijal at codespeak.net
Fri Jun 15 13:41:44 CEST 2007


Author: fijal
Date: Fri Jun 15 13:41:44 2007
New Revision: 44281

Modified:
   pypy/branch/kill-ctypes/pypy/module/posix/__init__.py
   pypy/branch/kill-ctypes/pypy/module/posix/interp_posix.py
   pypy/branch/kill-ctypes/pypy/module/posix/test/test_posix2.py
Log:
Add WIFSIGNALED in a module


Modified: pypy/branch/kill-ctypes/pypy/module/posix/__init__.py
==============================================================================
--- pypy/branch/kill-ctypes/pypy/module/posix/__init__.py	(original)
+++ pypy/branch/kill-ctypes/pypy/module/posix/__init__.py	Fri Jun 15 13:41:44 2007
@@ -52,6 +52,7 @@
     #'getuid'    : 'interp_posix.getuid',
     #'geteuid'   : 'interp_posix.geteuid',
     'utime'     : 'interp_posix.utime',
+    'WIFSIGNALED' : 'interp_posix.WIFSIGNALED',
     }
     if hasattr(os, 'ftruncate'):
         interpleveldefs['ftruncate'] = 'interp_posix.ftruncate'

Modified: pypy/branch/kill-ctypes/pypy/module/posix/interp_posix.py
==============================================================================
--- pypy/branch/kill-ctypes/pypy/module/posix/interp_posix.py	(original)
+++ pypy/branch/kill-ctypes/pypy/module/posix/interp_posix.py	Fri Jun 15 13:41:44 2007
@@ -497,3 +497,7 @@
             raise
         raise OperationError(space.w_TypeError, space.wrap(msg))
 utime.unwrap_spec = [ObjSpace, str, W_Root]
+
+def WIFSIGNALED(space, status):
+    return space.newbool(os.WIFSIGNALED(status))
+WIFSIGNALED.unwrap_spec = [ObjSpace, int]

Modified: pypy/branch/kill-ctypes/pypy/module/posix/test/test_posix2.py
==============================================================================
--- pypy/branch/kill-ctypes/pypy/module/posix/test/test_posix2.py	(original)
+++ pypy/branch/kill-ctypes/pypy/module/posix/test/test_posix2.py	Fri Jun 15 13:41:44 2007
@@ -192,6 +192,11 @@
         raises(TypeError, "os.utime('xxx', 3)")
         raises(OSError, "os.utime('somefilewhichihopewouldneverappearhere', None)")
 
+    def test_wifsignaled(self):
+        os = self.posix
+        assert os.WIFSIGNALED(0) == False
+        assert os.WIFSIGNALED(1) == True
+
 class AppTestEnvironment(object):
     def setup_class(cls): 
         cls.space = space 



More information about the Pypy-commit mailing list