summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@gmail.com>2010-05-17 16:59:23 (GMT)
committerJeffrey Yasskin <jyasskin@gmail.com>2010-05-17 16:59:23 (GMT)
commitea7b748891e32974876c9ad04224f77f82e2520a (patch)
tree4652414346bdeb8545727443296886bdbbcbe048 /Modules
parent7cf7d722633e9b76db47308c8a568f98febaae7f (diff)
downloadcpython-ea7b748891e32974876c9ad04224f77f82e2520a.zip
cpython-ea7b748891e32974876c9ad04224f77f82e2520a.tar.gz
cpython-ea7b748891e32974876c9ad04224f77f82e2520a.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_testcapimodule.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index ba81f71..e1dc5f4 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -2011,7 +2011,11 @@ static PyObject *
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;
}