]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-109045: Remove remaining LIMITED_API_AVAILABLE checks in tests (#109046)
authorAnders Kaseorg <andersk@mit.edu>
Thu, 7 Sep 2023 02:42:58 +0000 (19:42 -0700)
committerGitHub <noreply@github.com>
Thu, 7 Sep 2023 02:42:58 +0000 (04:42 +0200)
Commit 13a00078b81776b23b0b6add69b848382240d1f2 (#108663) made all
Python builds compatible with the Limited API, and removed the
LIMITED_API_AVAILABLE flag.  However, some tests were still checking
for that flag, so they were now being incorrectly skipped.  Remove
these checks to let these tests run again.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Lib/test/support/__init__.py
Modules/_testcapi/heaptype_relative.c
Modules/_testcapi/vectorcall_limited.c
Modules/_testcapimodule.c

index d39f529499ca50999090825287b5f5f02a43d4be..38ad965e155302759b4facf52c97e3f581202423 100644 (file)
@@ -1090,8 +1090,7 @@ def requires_limited_api(test):
         import _testcapi
     except ImportError:
         return unittest.skip('needs _testcapi module')(test)
-    return unittest.skipUnless(
-        _testcapi.LIMITED_API_AVAILABLE, 'needs Limited API support')(test)
+    return test
 
 def requires_specialization(test):
     return unittest.skipUnless(
index c247ca33b3370811d77b47ccbde73dd47c49f280..53dd01d1ed4f802d3a1073021bdc44acfb466d7d 100644 (file)
@@ -3,8 +3,6 @@
 #include <stddef.h>               // max_align_t
 #include <string.h>               // memset
 
-#ifdef LIMITED_API_AVAILABLE
-
 static PyType_Slot empty_slots[] = {
     {0, NULL},
 };
@@ -339,5 +337,3 @@ _PyTestCapi_Init_HeaptypeRelative(PyObject *m) {
 
     return 0;
 }
-
-#endif // LIMITED_API_AVAILABLE
index a96925e840121a720d07cb13c3d61200545a4244..e981c8625c2fb23b995a6c7a4cc1006eaf4bc5f6 100644 (file)
@@ -1,10 +1,6 @@
 #define Py_LIMITED_API 0x030c0000 // 3.12
 #include "parts.h"
 
-#ifdef LIMITED_API_AVAILABLE
-
-
-
 /* Test Vectorcall in the limited API */
 
 static PyObject *
@@ -175,5 +171,3 @@ _PyTestCapi_Init_VectorcallLimited(PyObject *m) {
 
     return 0;
 }
-
-#endif // LIMITED_API_AVAILABLE
index 5ff5172f4f30ebe1226aeb8533002b5dc9ce526d..9bd963baf066a4e2b906467fc030f5de8099fa7a 100644 (file)
@@ -3996,18 +3996,12 @@ PyInit__testcapi(void)
     if (_PyTestCapi_Init_PyAtomic(m) < 0) {
         return NULL;
     }
-
-#ifndef LIMITED_API_AVAILABLE
-    PyModule_AddObjectRef(m, "LIMITED_API_AVAILABLE", Py_False);
-#else
-    PyModule_AddObjectRef(m, "LIMITED_API_AVAILABLE", Py_True);
     if (_PyTestCapi_Init_VectorcallLimited(m) < 0) {
         return NULL;
     }
     if (_PyTestCapi_Init_HeaptypeRelative(m) < 0) {
         return NULL;
     }
-#endif
 
     PyState_AddModule(m, &_testcapimodule);
     return m;