Skip to content

Commit 2aeb070

Browse files
committed
(Merge 3.3) Issue python#14432: Fix compilation when thread support is disabled
2 parents c47fb54 + 258e4d3 commit 2aeb070

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎Modules/_testcapimodule.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2869,6 +2869,7 @@ PyDoc_STRVAR(docstring_with_signature_and_extra_newlines,
28692869
"This docstring has a valid signature and some extra newlines."
28702870
);
28712871

2872+
#ifdef WITH_THREAD
28722873
typedef struct {
28732874
PyThread_type_lock start_event;
28742875
PyThread_type_lock exit_event;
@@ -2955,6 +2956,8 @@ call_in_temporary_c_thread(PyObject *self, PyObject *callback)
29552956
PyThread_free_lock(test_c_thread.exit_event);
29562957
return res;
29572958
}
2959+
#endif /* WITH_THREAD */
2960+
29582961

29592962
static PyMethodDef TestMethods[] = {
29602963
{"raise_exception", raise_exception, METH_VARARGS},
@@ -3084,8 +3087,10 @@ static PyMethodDef TestMethods[] = {
30843087
{"docstring_with_signature_and_extra_newlines",
30853088
(PyCFunction)test_with_docstring, METH_NOARGS,
30863089
docstring_with_signature_and_extra_newlines},
3090+
#ifdef WITH_THREAD
30873091
{"call_in_temporary_c_thread", call_in_temporary_c_thread, METH_O,
30883092
PyDoc_STR("set_error_class(error_class) -> None")},
3093+
#endif
30893094
{NULL, NULL} /* sentinel */
30903095
};
30913096

0 commit comments

Comments
 (0)