diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-05-21 22:23:56 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-05-21 22:23:56 +0200 |
commit | 2a0f3d3fb2a7e26d47810098894f8e615571afe3 (patch) | |
tree | e402ca98134661b2a3f133083adf18bdc66151b6 /src/if_python.c | |
parent | 0b9aecc3a5020a3f3714bf4e58046321b46632fb (diff) | |
download | vim-git-2a0f3d3fb2a7e26d47810098894f8e615571afe3.tar.gz |
updated for version 7.3.1003v7.3.1003
Problem: Python interface does not compile with Python 2.2
Solution: Fix thread issues and True/False. (ZyX)
Diffstat (limited to 'src/if_python.c')
-rw-r--r-- | src/if_python.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/if_python.c b/src/if_python.c index 633481a06..8cc50c3cf 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -641,7 +641,7 @@ static int initialised = 0; #define DICTKEY_UNREF #define DICTKEY_DECL -#define DESTRUCTOR_FINISH(self) Py_TYPE(self)->tp_free((PyObject*)self); +#define DESTRUCTOR_FINISH(self) self->ob_type->tp_free((PyObject*)self); #define WIN_PYTHON_REF(win) win->w_python_ref #define BUF_PYTHON_REF(buf) buf->b_python_ref @@ -656,6 +656,15 @@ static PyObject *DictionaryGetattr(PyObject *, char*); static PyObject *ListGetattr(PyObject *, char *); static PyObject *FunctionGetattr(PyObject *, char *); +#ifndef Py_VISIT +# define Py_VISIT(obj) visit(obj, arg) +#endif +#ifndef Py_CLEAR +# define Py_CLEAR(obj) \ + Py_XDECREF(obj); \ + obj = NULL; +#endif + /* * Include the code shared with if_python3.c */ @@ -881,7 +890,11 @@ DoPyCommand(const char *cmd, rangeinitializer init_range, runner run, void *arg) Python_RestoreThread(); /* enter python */ #endif - run((char *) cmd, arg, &pygilstate); + run((char *) cmd, arg +#ifdef PY_CAN_RECURSE + , &pygilstate +#endif + ); #ifdef PY_CAN_RECURSE PyGILState_Release(pygilstate); |