diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 72d91db..6ffc74b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,9 +27,11 @@ jobs: - "3.11" - "3.12" - "3.13" + - "3.13t" # CPython 3.14 final is scheduled for October 2025: # https://peps.python.org/pep-0719/ - "3.14" + - "3.14t" # PyPy versions: # - https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md @@ -68,6 +70,8 @@ jobs: python: "3.12" - os: windows-latest python: "3.13" + - os: windows-latest + python: "3.13t" # macOS # Python 3.9 is the oldest version available on macOS/arm64. @@ -81,6 +85,8 @@ jobs: python: "3.12" - os: macos-latest python: "3.13" + - os: macos-latest + python: "3.13t" # Ubuntu: test deadsnakes Python versions which are not supported by # GHA python-versions. diff --git a/tests/test_pythoncapi_compat_cext.c b/tests/test_pythoncapi_compat_cext.c index 6e76316..c719d42 100644 --- a/tests/test_pythoncapi_compat_cext.c +++ b/tests/test_pythoncapi_compat_cext.c @@ -1432,29 +1432,48 @@ test_long_api(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args)) PyLongWriter *writer; static PyLongExport long_export; - writer = PyLongWriter_Create(1, 1, (void**)&digits); + writer = PyLongWriter_Create(1, 1, (void **)&digits); + if (writer == NULL) { + return NULL; + } PyLongWriter_Discard(writer); - writer = PyLongWriter_Create(1, 1, (void**)&digits); + writer = PyLongWriter_Create(1, 1, (void **)&digits); + if (writer == NULL) { + return NULL; + } digits[0] = 123; obj = PyLongWriter_Finish(writer); + if (obj == NULL) { + return NULL; + } check_int(obj, -123); - PyLong_Export(obj, &long_export); + if (PyLong_Export(obj, &long_export) < 0) { + return NULL; + } assert(long_export.value == -123); assert(long_export.digits == NULL); PyLong_FreeExport(&long_export); Py_DECREF(obj); - writer = PyLongWriter_Create(0, 5, (void**)&digits); + writer = PyLongWriter_Create(0, 5, (void **)&digits); + if (writer == NULL) { + return NULL; + } digits[0] = 1; digits[1] = 0; digits[2] = 0; digits[3] = 0; digits[4] = 1; obj = PyLongWriter_Finish(writer); + if (obj == NULL) { + return NULL; + } - PyLong_Export(obj, &long_export); + if (PyLong_Export(obj, &long_export) < 0) { + return NULL; + } assert(long_export.value == 0); digits = (digit*)long_export.digits; assert(digits[0] == 1);