diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-07-02 22:38:47 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-07-02 22:38:47 (GMT) |
commit | 1f900f1f69c93e409595f34a6da9e2b10e331421 (patch) | |
tree | cc8c26434cbfcac1bb6c80773bf124b3639e2ab5 /Objects | |
parent | 7c265a19433644fafcb8eca56633a83307f69739 (diff) | |
download | cpython-1f900f1f69c93e409595f34a6da9e2b10e331421.zip cpython-1f900f1f69c93e409595f34a6da9e2b10e331421.tar.gz cpython-1f900f1f69c93e409595f34a6da9e2b10e331421.tar.bz2 |
#3247: get rid of Py_FindMethod
Third step: unix-only modules. Really remove the function this time.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/methodobject.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 3d208c1..cb6f1ba 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -280,43 +280,6 @@ PyTypeObject PyCFunction_Type = { 0, /* tp_dict */ }; -/* Find a method in a method chain */ - -PyObject * -Py_FindMethodInChain(PyMethodChain *chain, PyObject *self, const char *name) -{ - if (name[0] == '_' && name[1] == '_') { - if (strcmp(name, "__doc__") == 0) { - const char *doc = self->ob_type->tp_doc; - if (doc != NULL) - return PyUnicode_FromString(doc); - } - } - while (chain != NULL) { - PyMethodDef *ml = chain->methods; - for (; ml->ml_name != NULL; ml++) { - if (name[0] == ml->ml_name[0] && - strcmp(name+1, ml->ml_name+1) == 0) - /* XXX */ - return PyCFunction_New(ml, self); - } - chain = chain->link; - } - PyErr_SetString(PyExc_AttributeError, name); - return NULL; -} - -/* Find a method in a single method list */ - -PyObject * -Py_FindMethod(PyMethodDef *methods, PyObject *self, const char *name) -{ - PyMethodChain chain; - chain.methods = methods; - chain.link = NULL; - return Py_FindMethodInChain(&chain, self, name); -} - /* Clear out the free list */ int |