]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-120584: Fix "unused thread_critical_sections" warning in `test_critical_sec...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 16 Jun 2024 17:38:00 +0000 (19:38 +0200)
committerGitHub <noreply@github.com>
Sun, 16 Jun 2024 17:38:00 +0000 (17:38 +0000)
gh-120584: Fix "unused thread_critical_sections" warning in `test_critical_sections` (GH-120585)
(cherry picked from commit b337aefd3e44f5c8e38cd282273359d07cce6126)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Modules/_testinternalcapi/test_critical_sections.c

index 1c0e049efafcb7d2647f90917c2badbb5424faf8..0129bd49ca93c3ba118a31103256b2cf051304f5 100644 (file)
@@ -130,6 +130,7 @@ test_critical_sections_suspend(PyObject *self, PyObject *Py_UNUSED(args))
     Py_RETURN_NONE;
 }
 
+#ifdef Py_CAN_START_THREADS
 struct test_data {
     PyObject *obj1;
     PyObject *obj2;
@@ -170,7 +171,6 @@ thread_critical_sections(void *arg)
     }
 }
 
-#ifdef Py_CAN_START_THREADS
 static PyObject *
 test_critical_sections_threads(PyObject *self, PyObject *Py_UNUSED(args))
 {