PyErr_SetString(PyExc_RuntimeError, "error when calling projector");
if (!PyErr_Occurred()) PyErr_SetString(PyExc_RuntimeError, "error when calling projector");
Jdsym_Proj(PyObject *proj, int n, double *x) {  PyObject *x_arr = NULL;  int dimensions[1];  PyObject *res;  dimensions[0] = n;  /* create array objects from x and y */  x_arr = PyArray_FromDimsAndData(1, dimensions, PyArray_DOUBLE, (char *)x);  if (x_arr == NULL)    goto fail;  /* Call "project" method of "proj" object */  res = PyObject_CallMethod(proj, "project", "O", x_arr);  if (res != Py_None) {    PyErr_SetString(PyExc_RuntimeError, "error when calling projector");    goto fail;  }  Py_DECREF(res);    /* free array objects */  Py_DECREF(x_arr);  return 0; fail:  Py_XDECREF(x_arr);  return -1;}