 retrieving revision 1.91
 diff -u -r1.91 vtkWrapPython.c
 --- Wrapping/vtkWrapPython.c	10 Dec 2008 20:58:40 -0000	1.91
-+++ Wrapping/vtkWrapPython.c	27 May 2009 14:19:14 -0000
++++ Wrapping/vtkWrapPython.c	27 May 2009 15:19:00 -0000
 @@ -1056,6 +1056,13 @@
                fprintf(fp,"    else\n      {\n");
                sprintf(methodname,"op->%s",currentFunction->Name);

retrieving revision 1.90
diff -u -r1.90 vtkPythonUtil.cxx
--- Common/vtkPythonUtil.cxx	6 Aug 2008 20:23:20 -0000	1.90
+++ Common/vtkPythonUtil.cxx	27 May 2009 14:19:14 -0000
@@ -22,6 +22,7 @@
 #include "vtkDataArray.h"
 #include "vtkObject.h"

                 
             switch (currentFunction->ReturnType % 0x1000)
               {
@@ -1090,6 +1097,27 @@
                 }
               }
             fprintf(fp,");\n");
+
+            /* Call successfully completed, we have to get back the
+             * thread-lock so that we can continue Python processing. */
+            fprintf(fp, "      PyEval_RestoreThread(_save);\n");
+
+            /* check if the special OutputWindow has set Python exception
+               information... */
+            fprintf(fp, "      if (PyErr_Occurred())\n");
+            fprintf(fp, "        return NULL;\n");
+
+            /* catch clause for any possible C++ exceptions (e.g. bad_alloc) */
+            fprintf(fp, "     }\n");
+            fprintf(fp, "     catch (vtkstd::exception &_e) {\n");
