]> granicus.if.org Git - python/commitdiff
Make sure that test_capsule always returns NULL on error; this may
authorMark Dickinson <dickinsm@gmail.com>
Sun, 13 Dec 2009 20:03:21 +0000 (20:03 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sun, 13 Dec 2009 20:03:21 +0000 (20:03 +0000)
help diagnose the sporadic test_capi failures on Solaris.

Modules/_testcapimodule.c

index f41d4fec0395c91ec16d60997cd256d409ac1df6..aca860adc5e701bfe2306100e0f7b6eeb1b5a191 100644 (file)
@@ -1298,6 +1298,21 @@ test_capsule(PyObject *self, PyObject *args)
        if (error) {
                return raiseTestError("test_capsule", error);
        }
+       /* 13/12/2009: something is causing test_capi to fail occasionally on
+          the Solaris buildbot, with the output:
+
+               internal test_L_code
+               internal test_Z_code
+               internal test_bug_7414
+               internal test_capsule
+               XXX undetected error
+               internaltest test_capi crashed -- <class 'ImportError'>: No module named datetime
+
+          It seems possible that test_capsule is raising an exception but
+          failing to return NULL.  Do a PyErr_Occurred check to find out.
+       */
+       if (PyErr_Occurred())
+               return NULL;
        Py_RETURN_NONE;
 #undef FAIL
 }