Commit e2a9e318 authored by Stefan Behnel's avatar Stefan Behnel

second try to fix classmethods

parent e1a600b5
...@@ -1409,6 +1409,10 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) { ...@@ -1409,6 +1409,10 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
else if (PyMethod_Check(method)) { /* python classes */ else if (PyMethod_Check(method)) { /* python classes */
return PyClassMethod_New(PyMethod_GET_FUNCTION(method)); return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
} }
else if (PyCFunction_Check(method)) {
return PyClassMethod_New(method);
}
printf("%s\\n", Py_TYPE(method)->tp_name);
PyErr_Format(PyExc_TypeError, "Class-level classmethod() can only be called on a method_descriptor or instance method."); PyErr_Format(PyExc_TypeError, "Class-level classmethod() can only be called on a method_descriptor or instance method.");
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment