Skip to content

Commit f42edf1

Browse files
authored
gh-109045: Remove remaining LIMITED_API_AVAILABLE checks in tests (#109046)
Commit 13a0007 (#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 <[email protected]>
1 parent 3bfa24e commit f42edf1

File tree

4 files changed

+1
-18
lines changed

4 files changed

+1
-18
lines changed

Lib/test/support/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1090,8 +1090,7 @@ def requires_limited_api(test):
10901090
import _testcapi
10911091
except ImportError:
10921092
return unittest.skip('needs _testcapi module')(test)
1093-
return unittest.skipUnless(
1094-
_testcapi.LIMITED_API_AVAILABLE, 'needs Limited API support')(test)
1093+
return test
10951094

10961095
def requires_specialization(test):
10971096
return unittest.skipUnless(

Modules/_testcapi/heaptype_relative.c

-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
#include <stddef.h> // max_align_t
44
#include <string.h> // memset
55

6-
#ifdef LIMITED_API_AVAILABLE
7-
86
static PyType_Slot empty_slots[] = {
97
{0, NULL},
108
};
@@ -339,5 +337,3 @@ _PyTestCapi_Init_HeaptypeRelative(PyObject *m) {
339337

340338
return 0;
341339
}
342-
343-
#endif // LIMITED_API_AVAILABLE

Modules/_testcapi/vectorcall_limited.c

-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#define Py_LIMITED_API 0x030c0000 // 3.12
22
#include "parts.h"
33

4-
#ifdef LIMITED_API_AVAILABLE
5-
6-
7-
84
/* Test Vectorcall in the limited API */
95

106
static PyObject *
@@ -175,5 +171,3 @@ _PyTestCapi_Init_VectorcallLimited(PyObject *m) {
175171

176172
return 0;
177173
}
178-
179-
#endif // LIMITED_API_AVAILABLE

Modules/_testcapimodule.c

-6
Original file line numberDiff line numberDiff line change
@@ -3996,18 +3996,12 @@ PyInit__testcapi(void)
39963996
if (_PyTestCapi_Init_PyAtomic(m) < 0) {
39973997
return NULL;
39983998
}
3999-
4000-
#ifndef LIMITED_API_AVAILABLE
4001-
PyModule_AddObjectRef(m, "LIMITED_API_AVAILABLE", Py_False);
4002-
#else
4003-
PyModule_AddObjectRef(m, "LIMITED_API_AVAILABLE", Py_True);
40043999
if (_PyTestCapi_Init_VectorcallLimited(m) < 0) {
40054000
return NULL;
40064001
}
40074002
if (_PyTestCapi_Init_HeaptypeRelative(m) < 0) {
40084003
return NULL;
40094004
}
4010-
#endif
40114005

40124006
PyState_AddModule(m, &_testcapimodule);
40134007
return m;

0 commit comments

Comments
 (0)