SF 548651: Fix the METH_CLASS implementation.

Most of these patches are from Thomas Heller, with long lines folded
by Tim.  The change to test_descr.py is from Guido.  See the bug report.

Not a bugfix candidate -- METH_CLASS is new in 2.3.
This commit is contained in:
Tim Peters 2002-12-09 22:56:13 +00:00
parent c7e3c5e306
commit bca1cbc6f8
5 changed files with 80 additions and 8 deletions

View file

@ -2435,7 +2435,7 @@ add_methods(PyTypeObject *type, PyMethodDef *meth)
"method cannot be both class and static");
return -1;
}
descr = create_specialmethod(meth, PyClassMethod_New);
descr = PyDescr_NewClassMethod(type, meth);
}
else if (meth->ml_flags & METH_STATIC) {
descr = create_specialmethod(meth, PyStaticMethod_New);