diff options
author | Peter Eisentraut | 2011-02-16 20:19:29 +0000 |
---|---|---|
committer | Peter Eisentraut | 2011-02-16 21:15:53 +0000 |
commit | 66d6b4cb54eb3b192c8f9087592e53c53c20cf06 (patch) | |
tree | 97603489117858d2ae1634277306ac7b65edc8ff /src/pl/plpython/plpython.c | |
parent | 497e65f822ff33ed964d1c891ee6de0d97d0b2a6 (diff) |
Fix for warnings-free compilation with Python 3.2
The first argument of PyEval_EvalCode() was changed from PyCodeObject*
to PyObject* because of PEP 384.
Diffstat (limited to 'src/pl/plpython/plpython.c')
-rw-r--r-- | src/pl/plpython/plpython.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index fff7de76743..82baf940e31 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -1220,8 +1220,13 @@ PLy_procedure_call(PLyProcedure *proc, char *kargs, PyObject *vargs) PyObject *rv; PyDict_SetItemString(proc->globals, kargs, vargs); +#if PY_VERSION_HEX >= 0x03020000 + rv = PyEval_EvalCode(proc->code, + proc->globals, proc->globals); +#else rv = PyEval_EvalCode((PyCodeObject *) proc->code, proc->globals, proc->globals); +#endif /* If the Python code returned an error, propagate it */ if (rv == NULL) |