[pypy-svn] r75504 - in pypy/branch/fast-ctypes/pypy/module/jitffi: . test
getxsick at codespeak.net
getxsick at codespeak.net
Tue Jun 22 18:47:34 CEST 2010
Author: getxsick
Date: Tue Jun 22 18:47:33 2010
New Revision: 75504
Modified:
pypy/branch/fast-ctypes/pypy/module/jitffi/interp_jitffi.py
pypy/branch/fast-ctypes/pypy/module/jitffi/test/test_jitffi.py
Log:
push the exception to app-level. 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:47:33 2010
@@ -70,12 +70,12 @@
def get_w(self, space, func, w_args_type, res_type='void'):
args_type_w = [ space.str_w(w_x)
for w_x in space.listview(w_args_type) ]
- return space.wrap(W_Get(space,
- self.cpu,
- space.wrap(self.lib_w),
- func,
- args_type_w,
- res_type))
+ try:
+ ret = W_Get(space, self.cpu, space.wrap(self.lib_w),
+ func, args_type_w, res_type)
+ except ValueError, e:
+ raise OperationError(space.w_ValueError, space.wrap(str(e)))
+ return space.wrap(ret)
def W_CDLL___new__(space, w_type, name):
try:
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:47:33 2010
@@ -93,5 +93,5 @@
import jitffi
lib = jitffi.CDLL(self.lib_name)
# xxxfoo888baryyy - not existed function
- py.test.raises(ValueError, lib.get, 'xxxfoo888baryyy', [])
- py.test.raises(ValueError, lib.get, 'xxxfoo888baryyy', ['int'], 'int')
+ raises(ValueError, lib.get, 'xxxfoo888baryyy', [])
+ raises(ValueError, lib.get, 'xxxfoo888baryyy', ['int'], 'int')
More information about the Pypy-commit
mailing list