[vtk-developers] Warnings with python 2.6, python guru wanted

Francois Bertel francois.bertel at kitware.com
Sun May 10 10:54:38 EDT 2009


Hi,

I already applied this patch on April 28, thanks for some internal
help at Kitware:
http://public.kitware.com/cgi-bin/viewcvs.cgi/Common/vtkPythonUtil.cxx?r1=1.90&r2=1.91

Good you answered anyway as it confirms the patch is correct.

Thanks!

On Sun, May 10, 2009 at 9:11 AM, Prabhu Ramachandran
<prabhu at aero.iitb.ac.in> wrote:
> On 04/25/09 22:31, Francois Bertel wrote:
>>
>> The first 6 warnings in VTK/Common/vtkPythonUtil.cxx on arkadia are
>> due to the use of Python 2.6 in Ubuntu 9.04:
>>
>> http://www.cdash.org/CDash/viewBuildError.php?type=1&buildid=319881
>>
>> I identified 2 issues:
>
> Thanks for tracking these:
>
> The resolution for issue 1 seems OK to me.
>
>> ISSUE2:
>>
>> the same /usr/include/python2.6/object.h also contains:
>>
>> typedef struct _typeobject {
>> [...]
>>       /* Type attribute cache version tag. Added in version 2.6 */
>>        unsigned int tp_version_tag;
>> [...]
>> } PyTypeObject;
>>
>>
>> How should PyVTKObjectType in VTK/Common/vtkPythonUtil.cxx be safely
>> changed to avoid the warning?
>>
>>
>
> I think you can replace this with:
>
>     52 #if   PY_VERSION_HEX >= 0x02030000
>     53 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
>     54   0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,
>     55 #elif PY_VERSION_HEX >= 0x02020000
>     56 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
>     57   0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0,
>     58 #else
>     59 #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED
>     60 #endif
>
> #if PY_VERSION_HEX >= 0x02060000
> #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
>  0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0
> #elif PY_VERSION_HEX >= 0x02030000
> #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
>  0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,
> #elif PY_VERSION_HEX >= 0x02020000
> #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED \
>  0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0,
> #else
> #define VTK_PYTHON_UTIL_SUPRESS_UNINITIALIZED
> #endif
>
> and try if that fixes it.  I haven't yet moved to 2.6 to know if that will
> work.
>
> Thanks.
>
> cheers,
> prabhu
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtk-developers mailing list