Your problem may be that an exception thrown in one .so isn't correctly caught 
in another .so.

In the dark past we had problems like this, too. To this day I don't import 
extensions
directly, but use a small wrapper function, import_ext(). The essential bit is

    sys.setdlopenflags(0x100|0x2)

The hex values are platform specific. IIRC it is RTLD_NOW | RTLD_GLOBAL (may be 
backwards).
You want to insert something like this right before importing your extension.


Full code:

http://cci.lbl.gov/cctbx_sources/boost_adaptbx/boost/python.py

Example boilerplate code for imports:

import boost.python
ext = boost.python.import_ext("scitbx_lbfgs_ext")
from scitbx_lbfgs_ext import *
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to