diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-02-04 20:17:26 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-02-04 20:17:26 +0100 |
commit | 7f85d297dc80666946f7940bc06e45cc2aa79b5d (patch) | |
tree | cda14c3f7f1b75c8a9769f58a0da62903040738e /src/if_python3.c | |
parent | 3c70f33440ae141b09d0d2dec279a65a015bfef0 (diff) | |
download | vim-git-7f85d297dc80666946f7940bc06e45cc2aa79b5d.tar.gz |
updated for version 7.3.422v7.3.422
Problem: Python 3 does not have __members__.
Solution: Add "name" and "number" in another way. (lilydjwg)
Diffstat (limited to 'src/if_python3.c')
-rw-r--r-- | src/if_python3.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/if_python3.c b/src/if_python3.c index 18d5b7779..ac6f1666c 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -468,6 +468,7 @@ get_py3_exceptions() static PyObject *BufferNew (buf_T *); static PyObject *WindowNew(win_T *); static PyObject *LineToString(const char *); +static PyObject *BufferDir(PyObject *, PyObject *); static PyTypeObject RangeType; @@ -961,13 +962,18 @@ BufferGetattro(PyObject *self, PyObject*nameobj) return Py_BuildValue("s", this->buf->b_ffname); else if (strcmp(name, "number") == 0) return Py_BuildValue("n", this->buf->b_fnum); - else if (strcmp(name,"__members__") == 0) - return Py_BuildValue("[ss]", "name", "number"); else return PyObject_GenericGetAttr(self, nameobj); } static PyObject * +BufferDir(PyObject *self UNUSED, PyObject *args UNUSED) +{ + return Py_BuildValue("[sssss]", "name", "number", + "append", "mark", "range"); +} + + static PyObject * BufferRepr(PyObject *self) { static char repr[100]; |