[pypy-commit] pypy reflex-support: From Uwe Hoffmann: more descriptive error messages when loading libs

wlav noreply at buildbot.pypy.org
Tue Aug 14 02:18:31 CEST 2012


Author: Wim Lavrijsen <WLavrijsen at lbl.gov>
Branch: reflex-support
Changeset: r56725:1333b15cd84e
Date: 2012-08-13 17:18 -0700
http://bitbucket.org/pypy/pypy/changeset/1333b15cd84e/

Log:	From Uwe Hoffmann: more descriptive error messages when loading libs

diff --git a/pypy/module/cppyy/interp_cppyy.py b/pypy/module/cppyy/interp_cppyy.py
--- a/pypy/module/cppyy/interp_cppyy.py
+++ b/pypy/module/cppyy/interp_cppyy.py
@@ -22,7 +22,7 @@
     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):
diff --git a/pypy/module/cppyy/test/test_fragile.py b/pypy/module/cppyy/test/test_fragile.py
--- a/pypy/module/cppyy/test/test_fragile.py
+++ b/pypy/module/cppyy/test/test_fragile.py
@@ -31,6 +31,11 @@
         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"""
 


More information about the pypy-commit mailing list