From: Stefan Behnel Date: Fri, 23 May 2008 20:31:27 +0000 (+0200) Subject: second try to fix classmethods X-Git-Tag: 0.9.8rc1~11^2~10^2~15^2~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e2a9e3180093a76f6970567d73d2fc3e97349e8d;p=cython.git second try to fix classmethods --- diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index ba2e9d8c..a5b1fd01 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -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; }