-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26995 from charris/backport-26985
BUG: Add object cast to avoid warning with limited API
- Loading branch information
Showing
4 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
numpy/_core/tests/examples/limited_api/limited_api_latest.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#if Py_LIMITED_API != PY_VERSION_HEX & 0xffff0000 | ||
# error "Py_LIMITED_API not defined to Python major+minor version" | ||
#endif | ||
|
||
#include <Python.h> | ||
#include <numpy/arrayobject.h> | ||
#include <numpy/ufuncobject.h> | ||
|
||
static PyModuleDef moduledef = { | ||
.m_base = PyModuleDef_HEAD_INIT, | ||
.m_name = "limited_api_latest" | ||
}; | ||
|
||
PyMODINIT_FUNC PyInit_limited_api_latest(void) | ||
{ | ||
import_array(); | ||
import_umath(); | ||
return PyModule_Create(&moduledef); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters