[vtkusers] Re: [vtk-developers] patch for turning (almost) all VTK errors into Python exceptions

Prabhu Ramachandran prabhu_r at users.sf.net
Sat Aug 5 13:50:26 EDT 2006


>>>>> "Charl" == Charl P Botha <cpbotha at cpbotha.net> writes:

    Charl> Hi there (Python)-gang, I've made a patch for VTK 5.0 which
    Charl> will turn almost all VTK errors into Python exceptions.  It
    Charl> works around the exception non-safety of VTK.  Have a look
    Charl> here:

    Charl> http://visualisation.tudelft.nl/~cpbotha/thingies/python_exceptions_vtk5.0.diff

[...]
    Charl> What do VTK/Python people think?  This definitely fills a
    Charl> niche, and it could be conditionally included in VTK.  The
    Charl> only drawback is the extra PyErr_Occurred() call after
    Charl> every VTK method call, and of course the extra line or two
    Charl> of Python code to set up the new vtkEventOutputWindow).

This is nice, thanks.  However, does this work for errors generated by
VTK objects that were not instantiated in Python?  Do exceptions
"leak" in this case?  From what I can tell of the patch, the answer is
yes.  If so is this a problem, and how big is it?

cheers,
prabhu





More information about the vtkusers mailing list