Skip to content

Commit

Permalink
Python: Replace deprecated PyEval_CallObject
Browse files Browse the repository at this point in the history
Closes #565
  • Loading branch information
jschueller committed Aug 15, 2024
1 parent 58995c2 commit d716820
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/swig/nlopt-python.i
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static double func_python(unsigned n, const double *x, double *grad, void *f)
: PyArray_SimpleNew(1, &sz0, NPY_DOUBLE);

PyObject *arglist = Py_BuildValue("OO", xpy, gradpy);
PyObject *result = PyEval_CallObject((PyObject *) f, arglist);
PyObject *result = PyObject_Call((PyObject *) f, arglist, NULL);
Py_DECREF(arglist);

Py_DECREF(gradpy);
Expand Down Expand Up @@ -192,7 +192,7 @@ static void mfunc_python(unsigned m, double *result,
: PyArray_SimpleNew(1, &sz0, NPY_DOUBLE);

PyObject *arglist = Py_BuildValue("OOO", rpy, xpy, gradpy);
PyObject *res = PyEval_CallObject((PyObject *) f, arglist);
PyObject *res = PyObject_Call((PyObject *) f, arglist, NULL);
Py_XDECREF(res);
Py_DECREF(arglist);

Expand Down

0 comments on commit d716820

Please sign in to comment.