diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2010-02-23 09:49:38 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2010-02-23 09:49:38 +0000 |
commit | 5d6c8bc18261caf7162aefdeb637f00ce00e238f (patch) | |
tree | 535ac1d7ef5be2d318874395f68889be368111ef /numpy/numarray/_capi.c | |
parent | ea6ca76d189e8ec5acf150cec31446e65c2426ff (diff) | |
download | numpy-5d6c8bc18261caf7162aefdeb637f00ce00e238f.tar.gz |
BUG: Replace deprecated PyCObject by PyCapsule for Python >= 3.1.
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 */ |