diff options
author | Guido van Rossum <guido@python.org> | 2002-01-15 19:21:05 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-01-15 19:21:05 (GMT) |
commit | 4f3a62d9bcc5219cfda370f540e6040a878d3b4f (patch) | |
tree | 4cc5f0e0b04e24be4360b07c8060500fcb4fb6a6 /Modules/newmodule.c | |
parent | 5e99731ab9e4706b4b06a57e3f429d2447071b4d (diff) | |
download | cpython-4f3a62d9bcc5219cfda370f540e6040a878d3b4f.zip cpython-4f3a62d9bcc5219cfda370f540e6040a878d3b4f.tar.gz cpython-4f3a62d9bcc5219cfda370f540e6040a878d3b4f.tar.bz2 |
There's no need for typechecks on the second and third argument of
new.instancemethod() -- the instancemethod object is now a perfectly
general container.
This fixes SF bug ##503091 (Pedro Rodriquez): new.instancemethod fails
for new classes
This is a 2.2.1 candidate.
Diffstat (limited to 'Modules/newmodule.c')
-rw-r--r-- | Modules/newmodule.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Modules/newmodule.c b/Modules/newmodule.c index 252637a..0a48926 100644 --- a/Modules/newmodule.c +++ b/Modules/newmodule.c @@ -40,10 +40,8 @@ new_instancemethod(PyObject* unused, PyObject* args) PyObject* self; PyObject* classObj; - if (!PyArg_ParseTuple(args, "OOO!:instancemethod", - &func, - &self, - &PyClass_Type, &classObj)) + if (!PyArg_ParseTuple(args, "OOO:instancemethod", + &func, &self, &classObj)) return NULL; if (!PyCallable_Check(func)) { PyErr_SetString(PyExc_TypeError, @@ -52,11 +50,6 @@ new_instancemethod(PyObject* unused, PyObject* args) } if (self == Py_None) self = NULL; - else if (!PyInstance_Check(self)) { - PyErr_SetString(PyExc_TypeError, - "second argument must be instance or None"); - return NULL; - } return PyMethod_New(func, self, classObj); } |