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.
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 0b7f00d..193b0cc 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2435,7 +2435,7 @@
"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);