Re: [pygccxml-development] Exceptions and Multi-Module Development
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2011-03-07 19:07:05
|
On Mon, Mar 7, 2011 at 8:32 PM, Scott Sturdivant <sc...@bi...> wrote: > Hi, > I'm experiencing strange behavior with the techniques described by the > multi-module development documentation. > > With the attached example, I have a common extension that's able to perform > exception translation. I'm able to use it like this: > > scott@blargh-desktop:~/workspace/excepTest$ python > Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) > [GCC 4.4.5] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> from usage import usage >>>> usage.UseThem().foo() > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > RuntimeError: unidentifiable C++ exception >>>> from myexception import libmyexception >>>> usage.UseThem().foo() > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > RuntimeError: This is my exception. > > However, if I compile and run this code on a different machine, I get the > following behavior: > > ssturdiv other-desktop:~/excepTest [753]% python > Python 2.6.5 (r265:79063, Oct 13 2010, 08:09:12) > [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> from myexception import > KeyboardInterrupt >>>> from usage import usage >>>> usage.UseThem().foo() > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > RuntimeError: unidentifiable C++ exception >>>> from myexception import libmyexception >>>> usage.UseThem().foo() > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > RuntimeError: unidentifiable C++ exception >>>> > > For the machine that works, my version of libboost_python is 1.42 whereas on > the machine that doesn't work, I'm using version 1.43. Similarly, > pyplusplus.__version__ shows '1.5.0' on the working machine, '1.0.0' on the > non-working one. There are other difference like the default gcc. May I ask you to try to add the following line: import sys sys.setdlopenflags(RTLD_NOW | RTLD_GLOBAL) If this helps, I suggest you to use technique described here: http://www.boost.org/doc/libs/1_46_0/libs/python/doc/tutorial/doc/html/python/techniques.html#python.creating_packages It will save you some time later. > Does this behavior ring any bells for someone? Would an upgrade on the > non-working machine solve the problem? I'm somewhat hesitant to upgrade, as > the non-working machine has its Py++ installed from the 1.0.0 release zip > file. Correct me if I'm wrong, but upgrading at this point would involve > just grabbing HEAD from SVN? Yes, but I don't believe your issue will gone. HTH |