summaryrefslogtreecommitdiff
path: root/src/if_python3.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-14 15:56:09 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-14 15:56:09 +0200
commit8110a091bc749d8748a20807a724a3af3ca6d509 (patch)
tree87a81daf5175f9c892e6eca0e36f64a6400a1cb6 /src/if_python3.c
parent58de0e2dcc1f2d251b74892a06d71a14973f3187 (diff)
downloadvim-git-8110a091bc749d8748a20807a724a3af3ca6d509.tar.gz
patch 7.4.1731v7.4.1731
Problem: Python: turns partial into simple funcref. Solution: Use partials like partials. (Nikolai Pavlov, closes #734)
Diffstat (limited to 'src/if_python3.c')
-rw-r--r--src/if_python3.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/if_python3.c b/src/if_python3.c
index 5cf508fc7..d2f6066cb 100644
--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -1528,14 +1528,16 @@ ListSetattro(PyObject *self, PyObject *nameobj, PyObject *val)
static PyObject *
FunctionGetattro(PyObject *self, PyObject *nameobj)
{
+ PyObject *r;
FunctionObject *this = (FunctionObject *)(self);
GET_ATTR_STRING(name, nameobj);
- if (strcmp(name, "name") == 0)
- return PyUnicode_FromString((char *)(this->name));
-
- return PyObject_GenericGetAttr(self, nameobj);
+ r = FunctionAttr(this, name);
+ if (r || PyErr_Occurred())
+ return r;
+ else
+ return PyObject_GenericGetAttr(self, nameobj);
}
/* External interface