[pypy-svn] r75506 - in pypy/branch/fast-ctypes/pypy/module/jitffi: . test

getxsick at codespeak.net getxsick at codespeak.net
Tue Jun 22 18:54:53 CEST 2010


Author: getxsick
Date: Tue Jun 22 18:54:52 2010
New Revision: 75506

Modified:
   pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py
   pypy/branch/fast-ctypes/pypy/module/jitffi/test/test_jitffi.py
Log:
another exception pushed to app-level. more more tests pass


Modified: pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py
==============================================================================
--- pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py	(original)
+++ pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py	Tue Jun 22 18:54:52 2010
@@ -65,7 +65,10 @@
     def __init__(self, space, name):
         self.space = space
         rjitffi.CDLL.__init__(self, name, load=False)
-        self.lib_w = W_LibHandler(self.space, name)
+        try:
+            self.lib_w = W_LibHandler(self.space, name)
+        except OSError, e:
+            raise OperationError(space.w_OSError, space.wrap(str(e)))
 
     def get_w(self, space, func, w_args_type, res_type='void'):
         args_type_w = [ space.str_w(w_x)

Modified: pypy/branch/fast-ctypes/pypy/module/jitffi/test/test_jitffi.py
==============================================================================
--- pypy/branch/fast-ctypes/pypy/module/jitffi/test/test_jitffi.py	(original)
+++ pypy/branch/fast-ctypes/pypy/module/jitffi/test/test_jitffi.py	Tue Jun 22 18:54:52 2010
@@ -57,8 +57,9 @@
         cls.space = space
         cls.w_lib_name = space.wrap(cls.preprare_c_example())
 
-    #def test_missing_lib(self):
-    #    py.test.raises(OSError, rjitffi.CDLL, 'xxxfoo888baryyy')
+    def test_missing_lib(self):
+        import jitffi
+        raises(OSError, jitffi.CDLL, 'xxxfoo888baryyy')
 
     def test_get(self):
         import jitffi



More information about the Pypy-commit mailing list