Skip to content

Commit 258e4d3

Browse files
committed
Issue python#14432: Fix compilation when thread support is disabled
1 parent 1310510 commit 258e4d3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎Modules/_testcapimodule.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,6 +2477,7 @@ test_pytime_object_to_timespec(PyObject *self, PyObject *args)
24772477
return Py_BuildValue("Nl", _PyLong_FromTime_t(sec), nsec);
24782478
}
24792479

2480+
#ifdef WITH_THREAD
24802481
typedef struct {
24812482
PyThread_type_lock start_event;
24822483
PyThread_type_lock exit_event;
@@ -2563,6 +2564,7 @@ call_in_temporary_c_thread(PyObject *self, PyObject *callback)
25632564
PyThread_free_lock(test_c_thread.exit_event);
25642565
return res;
25652566
}
2567+
#endif /* WITH_THREAD */
25662568

25672569

25682570
static PyMethodDef TestMethods[] = {
@@ -2661,8 +2663,10 @@ static PyMethodDef TestMethods[] = {
26612663
{"pytime_object_to_time_t", test_pytime_object_to_time_t, METH_VARARGS},
26622664
{"pytime_object_to_timeval", test_pytime_object_to_timeval, METH_VARARGS},
26632665
{"pytime_object_to_timespec", test_pytime_object_to_timespec, METH_VARARGS},
2666+
#ifdef WITH_THREAD
26642667
{"call_in_temporary_c_thread", call_in_temporary_c_thread, METH_O,
26652668
PyDoc_STR("set_error_class(error_class) -> None")},
2669+
#endif
26662670
{NULL, NULL} /* sentinel */
26672671
};
26682672

0 commit comments

Comments
 (0)