Quantcast

Python 2.6 SWIG_TYPE_TABLE define not working

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Python 2.6 SWIG_TYPE_TABLE define not working

Bill Somerville

Hi All,

 

I have a problem with extension modules not being independent when they should be.

 

The setup is a C API being wrapped and the target language is Python. There are two extension modules that are essentially the same but should not be related i.e. the module name is the same but any class names etc. in both should refer to different types.

 

With Python versions above 2.6 this works so long as the macro SWIG_TYPE_TABLE is defined to something different for each module_wrap.c compile but on Python 2.6 we are seeing wrapper functions in the wrong extension module being called when the call is the result of a destructor added to a type via the %extend mechanism (a call to _wrap_delete_Type). The function being called is always the one from the last module loaded into Python. For example:

 

from xxx.a import yyy as yyya

from xxx.b import yyy as yyyb

 

var = yyya.Type()

del var

 

this will call _wrap_delete_Type from the xxx.b.yyy extension module rather than the xxx.a.yyy extension module as it should.

 

Any ideas on how to resolve this for Python 2.6 as the target language?

 

Regards

Bill Somerville.


------------------------------------------------------------------------------

_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Loading...