Commits

wlav committed 1333b15

From Uwe Hoffmann: more descriptive error messages when loading libs

Comments (0)

Files changed (2)

pypy/module/cppyy/interp_cppyy.py

     try:
         cdll = capi.c_load_dictionary(name)
     except rdynload.DLOpenError, e:
-        raise OperationError(space.w_RuntimeError, space.wrap(str(e)))
+        raise OperationError(space.w_RuntimeError, space.wrap(str(e.msg)))
     return W_CPPLibrary(space, cdll)
 
 class State(object):

pypy/module/cppyy/test/test_fragile.py

         import cppyy
         raises(RuntimeError, cppyy.load_reflection_info, "does_not_exist.so")
 
+        try:
+            cppyy.load_reflection_info("does_not_exist.so")
+        except RuntimeError, e:
+            assert "does_not_exist.so" in str(e)
+
     def test02_missing_classes(self):
         """Test (non-)access to missing classes"""