Merge branch 'stable' into develop

This commit is contained in:
Anne de Jong 2022-05-17 15:07:34 +02:00
commit 9e03f5e944

View File

@ -91,12 +91,12 @@ static inline PyObject *data_to_ndarray(void *data, int n_rows, int n_cols,
// https://stackoverflow.com/questions/54269956/crash-of-jupyter-due-to-the-use-of-pyarray-enableflags/54278170#54278170 // https://stackoverflow.com/questions/54269956/crash-of-jupyter-due-to-the-use-of-pyarray-enableflags/54278170#54278170
// Note that in general it was disadvised to build all C code with MinGW on // Note that in general it was disadvised to build all C code with MinGW on
// Windows. We do it anyway, see if we find any problems on the way. // Windows. We do it anyway, see if we find any problems on the way.
PyObject *capsule = PyCapsule_New(data, LASP_CAPSULE_NAME, capsule_cleanup); /* PyObject *capsule = PyCapsule_New(data, LASP_CAPSULE_NAME, capsule_cleanup); */
int res = PyArray_SetBaseObject(arr, capsule); /* int res = PyArray_SetBaseObject(arr, capsule); */
if (res != 0) { /* if (res != 0) { */
fprintf(stderr, "Failed to set base object of array!"); /* fprintf(stderr, "Failed to set base object of array!"); */
return NULL; /* return NULL; */
} /* } */
PyArray_ENABLEFLAGS(arr, NPY_OWNDATA); PyArray_ENABLEFLAGS(arr, NPY_OWNDATA);
} }