diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-05-29 22:36:10 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-05-29 22:36:10 +0200 |
commit | dd8aca664d9768614d18cebec84badc3ecad3af5 (patch) | |
tree | 6002f0821e725f7829f73bc05336f4fc4ca376a3 /src/if_python3.c | |
parent | 432b09c84dc6daf0b7ca8dac986bc0b1faf899d7 (diff) | |
download | vim-git-dd8aca664d9768614d18cebec84badc3ecad3af5.tar.gz |
updated for version 7.3.1047v7.3.1047
Problem: Python: dir() does not work properly.
Solution: Python patch 8. Add __dir__ method to all objects with custom
tp_getattr supplemented by __members__ attribute for at least
python-2* versions. __members__ is not mentioned in python-3*
dir() output even if it is accessible. (ZyX)
Diffstat (limited to 'src/if_python3.c')
-rw-r--r-- | src/if_python3.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/if_python3.c b/src/if_python3.c index 923d04696..02132d63d 100644 --- a/src/if_python3.c +++ b/src/if_python3.c @@ -666,7 +666,6 @@ call_PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems) return PyType_GenericAlloc(type,nitems); } -static PyObject *BufferDir(PyObject *); static PyObject *OutputGetattro(PyObject *, PyObject *); static int OutputSetattro(PyObject *, PyObject *, PyObject *); static PyObject *BufferGetattro(PyObject *, PyObject *); @@ -1094,14 +1093,6 @@ BufferSetattro(PyObject *self, PyObject *nameobj, PyObject *val) return BufferSetattr((BufferObject *)(self), name, val); } - static PyObject * -BufferDir(PyObject *self UNUSED) -{ - return Py_BuildValue("[ssssssss]", - "name", "number", "vars", "options", "valid", - "append", "mark", "range"); -} - /******************/ static PyObject * @@ -1368,8 +1359,11 @@ static PySequenceMethods WinListAsSeq = { static PyObject * CurrentGetattro(PyObject *self, PyObject *nameobj) { + PyObject *r; GET_ATTR_STRING(name, nameobj); - return CurrentGetattr(self, name); + if (!(r = CurrentGetattr(self, name))) + return PyObject_GenericGetAttr(self, nameobj); + return r; } static int |