mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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:
parent
c7e3c5e306
commit
bca1cbc6f8
5 changed files with 80 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue