diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c --- a/PC/bdist_wininst/install.c +++ b/PC/bdist_wininst/install.c @@ -671,35 +671,35 @@ static HINSTANCE LoadPythonDll(char *fna } static int prepare_script_environment(HINSTANCE hPython) { PyObject *mod; DECLPROC(hPython, PyObject *, PyImport_ImportModule, (char *)); DECLPROC(hPython, int, PyObject_SetAttrString, (PyObject *, char *, PyObject *)); DECLPROC(hPython, PyObject *, PyObject_GetAttrString, (PyObject *, char *)); - DECLPROC(hPython, PyObject *, PyCFunction_New, (PyMethodDef *, PyObject *)); + DECLPROC(hPython, PyObject *, PyCFunction_NewEx, (PyMethodDef *, PyObject *, PyObject *)); DECLPROC(hPython, PyObject *, Py_BuildValue, (char *, ...)); DECLPROC(hPython, int, PyArg_ParseTuple, (PyObject *, char *, ...)); DECLPROC(hPython, PyObject *, PyErr_Format, (PyObject *, char *)); DECLPROC(hPython, PyObject *, PyLong_FromVoidPtr, (void *)); if (!PyImport_ImportModule || !PyObject_GetAttrString || - !PyObject_SetAttrString || !PyCFunction_New) + !PyObject_SetAttrString || !PyCFunction_NewEx) return 1; if (!Py_BuildValue || !PyArg_ParseTuple || !PyErr_Format) return 1; mod = PyImport_ImportModule("builtins"); if (mod) { int i; g_PyExc_ValueError = PyObject_GetAttrString(mod, "ValueError"); g_PyExc_OSError = PyObject_GetAttrString(mod, "OSError"); for (i = 0; i < DIM(meth); ++i) { PyObject_SetAttrString(mod, meth[i].ml_name, - PyCFunction_New(&meth[i], NULL)); + PyCFunction_NewEx(&meth[i], NULL, NULL)); } } g_Py_BuildValue = Py_BuildValue; g_PyArg_ParseTuple = PyArg_ParseTuple; g_PyErr_Format = PyErr_Format; g_PyLong_FromVoidPtr = PyLong_FromVoidPtr; return 0; @@ -720,29 +720,29 @@ do_run_installscript(HINSTANCE hPython, { int fh, result, i; static wchar_t *wargv[256]; DECLPROC(hPython, void, Py_Initialize, (void)); DECLPROC(hPython, int, PySys_SetArgv, (int, wchar_t **)); DECLPROC(hPython, int, PyRun_SimpleString, (char *)); DECLPROC(hPython, void, Py_Finalize, (void)); DECLPROC(hPython, PyObject *, Py_BuildValue, (char *, ...)); - DECLPROC(hPython, PyObject *, PyCFunction_New, - (PyMethodDef *, PyObject *)); + DECLPROC(hPython, PyObject *, PyCFunction_NewEx, + (PyMethodDef *, PyObject *, PyObject *)); DECLPROC(hPython, int, PyArg_ParseTuple, (PyObject *, char *, ...)); DECLPROC(hPython, PyObject *, PyErr_Format, (PyObject *, char *)); if (!Py_Initialize || !PySys_SetArgv || !PyRun_SimpleString || !Py_Finalize) return 1; if (!Py_BuildValue || !PyArg_ParseTuple || !PyErr_Format) return 1; - if (!PyCFunction_New || !PyArg_ParseTuple || !PyErr_Format) + if (!PyCFunction_NewEx || !PyArg_ParseTuple || !PyErr_Format) return 1; if (pathname == NULL || pathname[0] == '\0') return 2; fh = open(pathname, _O_RDONLY | O_NOINHERIT); if (-1 == fh) { fprintf(stderr, "Could not open postinstall-script %s\n",