laywerrobot/lib/python3.6/site-packages/gensim/models/voidptr.h

17 lines
310 B
C
Raw Normal View History

2020-08-27 21:55:39 +02:00
#include <Python.h>
#if PY_VERSION_HEX >= 0x03020000
/*
** compatibility with python >= 3.2, which doesn't have CObject anymore
*/
static void * PyCObject_AsVoidPtr(PyObject *obj)
{
void *ret = PyCapsule_GetPointer(obj, NULL);
if (ret == NULL) {
PyErr_Clear();
}
return ret;
}
#endif