[vtk-developers] vtkMathTextUtilities and otherPrint test

David Cole david.cole at kitware.com
Tue Jul 10 13:32:43 EDT 2012


Instead of the goto's, how about something like:

  bool err = this->CheckForError();

if (!err)
{
   mplMathTextLib = PyImport_ImportModule("matplotlib.mathtext");
   err = this->CheckForError(mplMathTextLib);
}

if (!err)
{
  mathTextParser = PyObject_GetAttrString(mplMathTextLib, "MathTextParser");
   err = this->CheckForError(mathTextParser);
    }

if (!err)
{
  this->Parser =

    PyObject_CallFunction(mathTextParser, const_cast<char*>("s"), "bitmap");
  err = this->CheckForError(this->Parser);

if (err)
     {
     // in case the error was an exception.
     delete this->Parser;
     this->Parser = NULL;
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20120710/8f850e31/attachment.html>


More information about the vtk-developers mailing list