[vtk-developers] Patch to vtkWrapPython.c to make wrapped Python code GIL-friendly

Charl P. Botha cpbotha at gmail.com
Wed Jul 13 15:24:40 EDT 2005


On 7/13/05, David Cole <david.cole at kitware.com> wrote:
> It's always best to prevent crashing in the first place... right? You
> could use a CMake construct like this:
>   GET_FILENAME_COMPONENT(LIBNAME ${PYTHON_LIBRARY} NAME_WE)
>   STRING(REGEX REPLACE "python" "" LIBVER "${LIBNAME}")
>   IF(LIBVER LESS 23)
>     MESSAGE(SEND_ERROR "VTK_WRAP_PYTHON requires a minimum of Python
> version 2.3.\nUpgrade python or set VTK_WRAP_PYTHON to OFF to avoid this
> error.")
>   ENDIF(LIBVER LESS 23)
> 
> ...if the following hold true:
> VTK_WRAP_PYTHON is ON
> PYTHON_LIBRARY is found/set
> python libs are always named pythonNN where NN can be legally compared
> to a value like 23... (Assuming future Python 3.0 will be named
> python30.lib/a/so/dll...)

This would force everybody to upgrade to python 2.3, which is not
always practical.  Perhaps this check could be combined with threading
on/off, i.e. if someone has a python < 2.3 and wants python wrappings,
threading has to be deactivated.



-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/

c.p.botha ||at|| ewi.tudelft.nl - tu delft work-related email
cpbotha ||at|| cpbotha.net - everything else



More information about the vtk-developers mailing list