diff options
Diffstat (limited to 'numpy/numarray/_capi.c')
-rw-r--r-- | numpy/numarray/_capi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/numarray/_capi.c b/numpy/numarray/_capi.c index c75baf280..261ca9776 100644 --- a/numpy/numarray/_capi.c +++ b/numpy/numarray/_capi.c @@ -3380,7 +3380,11 @@ PyMODINIT_FUNC init_capi(void) _Error = PyErr_NewException("numpy.numarray._capi.error", NULL, NULL); /* Create a CObject containing the API pointer array's address */ +#if defined(NPY_PY3K) + c_api_object = PyCapsule_New((void *)libnumarray_API, NULL, NULL); +#else c_api_object = PyCObject_FromVoidPtr((void *)libnumarray_API, NULL); +#endif if (c_api_object != NULL) { /* Create a name for this object in the module's namespace */ |