[Python-checkins] r81269 - python/branches/py3k/Modules/_testcapimodule.c

jeffrey.yasskin python-checkins at python.org
Mon May 17 18:59:23 CEST 2010


Author: jeffrey.yasskin
Date: Mon May 17 18:59:23 2010
New Revision: 81269

Log:
Fix test_capi in !pydebug mode, where my original attempt segfaulted without
producing the expected error message.  The test only tests what it's supposed
to test in pydebug mode though.  Fixes issue 8726.


Modified:
   python/branches/py3k/Modules/_testcapimodule.c

Modified: python/branches/py3k/Modules/_testcapimodule.c
==============================================================================
--- python/branches/py3k/Modules/_testcapimodule.c	(original)
+++ python/branches/py3k/Modules/_testcapimodule.c	Mon May 17 18:59:23 2010
@@ -2011,7 +2011,11 @@
 crash_no_current_thread(PyObject *self)
 {
     Py_BEGIN_ALLOW_THREADS
-    PyErr_SetString(PyExc_SystemError, "bork bork bork");
+    /* Using PyThreadState_Get() directly allows the test to pass in
+       !pydebug mode. However, the test only actually tests anything
+       in pydebug mode, since that's where the infinite loop was in
+       the first place. */
+    PyThreadState_Get();
     Py_END_ALLOW_THREADS
     return NULL;
 }


More information about the Python-checkins mailing list