[vtkusers] RFC: patch for VTK errors as python exceptions and trapping of bad_alloc
Charl Botha
c.p.botha at tudelft.nl
Tue Nov 6 17:58:38 EST 2007
Dear all,
I have just updated the Python VTK errors as exception + bad_alloc
trapping patch to the latest ParaView-3-2 branch checkout of VTK (it
should be applicable to head) and made it available at [1]. This
patch:
1. turns all VTK errors into Python exceptions. It even maintains
exception information if a user observer is invoked before the end of
the VTK method that triggered the error.
2. surrounds all VTK method calls in the Python wrappers with
try...catch, so that we can catch things like bad_alloc as well.
I've been running with this for quite a while, it seems quite solid
and I would like to commit it. However, I would appreciate some
general comments, and especially on the try...catch, as it's causing
my VS 2005 to generate hundreds of "unreachable code" warnings in the
wrapper code. Does anyone know how to get around these? I assume
it's because the surrounded VTK method doesn't have a throws
classifier. Any other thoughts?
Thanks,
Charl
[1] http://visualisation.tudelft.nl/~cpbotha/files/vtk_itk/patches/pyvtk_tryexcept_and_pyexceptions_20071106.diff
More information about the vtkusers
mailing list