gh-116417: Move 4 limited C API test files to _testlimitedcapi (#116571)

Move the following files from Modules/_testcapi/ to
Modules/_testlimitedcapi/:

* bytearray.c
* bytes.c
* pyos.c
* sys.c

Changes:

* Replace PyBytes_AS_STRING() with PyBytes_AsString().
* Replace PyBytes_GET_SIZE() with PyBytes_Size().
* Update related test_capi tests.
* Copy Modules/_testcapi/util.h to Modules/_testlimitedcapi/util.h.
This commit is contained in:
Victor Stinner 2024-03-11 11:28:16 +01:00 • committed by GitHub
parent d8712fa0c7
commit 1cc02ca063
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 101 additions and 80 deletions

View file

@ -26,11 +26,23 @@ PyInit__testlimitedcapi(void)
return NULL;
}
if (_PyTestCapi_Init_VectorcallLimited(mod) < 0) {
if (_PyTestCapi_Init_ByteArray(mod) < 0) {
return NULL;
}
if (_PyTestCapi_Init_Bytes(mod) < 0) {
return NULL;
}
if (_PyTestCapi_Init_HeaptypeRelative(mod) < 0) {
return NULL;
}
if (_PyTestCapi_Init_PyOS(mod) < 0) {
return NULL;
}
if (_PyTestCapi_Init_Sys(mod) < 0) {
return NULL;
}
if (_PyTestCapi_Init_VectorcallLimited(mod) < 0) {
return NULL;
}
return mod;
}