From e2a9e3180093a76f6970567d73d2fc3e97349e8d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 23 May 2008 22:31:27 +0200 Subject: [PATCH] second try to fix classmethods --- Cython/Compiler/Symtab.py | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.26.2