second try to fix classmethods
authorStefan Behnel <scoder@users.berlios.de>
Fri, 23 May 2008 20:31:27 +0000 (22:31 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 23 May 2008 20:31:27 +0000 (22:31 +0200)
Cython/Compiler/Symtab.py

index ba2e9d8cc2e4b47e2e8d1a26b62431e489bb30bc..a5b1fd01c1f1d238758c827e6cc1e78151494c7c 100644 (file)
@@ -1409,6 +1409,10 @@ static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
     else if (PyMethod_Check(method)) {                                /* python classes */
         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.");
     return NULL;
 }