[Cython] [PATCH] Make __Pyx_ArgTypeTest() use "const char*" to suppress warning
Stefan Behnel
stefan_ml at behnel.de
Wed Sep 10 16:35:25 CEST 2008
Ondrej Certik wrote:
> On Mon, Sep 8, 2008 at 5:12 PM, Lisandro Dalcin <dalcinl at gmail.com> wrote:
>> In Python 2.3 and 2.4 we have this:
>>
>> PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, char *);
>>
>> In Python 2.5 and above, we have this:
>>
>> PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *);
>>
>>
>> So pehaps we need the a define of inline function
>> __Pyx_PyObject_GetAttr() that do the special-case according to the
>> Python version.
>
> Either way is fine. Clearly the current state, that it prints the
> warnings is a bug, so it should be fixed (either way).
This specific case is easy to handle as we can replace
PyObject_GetAttrString() by the equivalent PyObject_GetAttr() call and
create the Python string ourselves (which would normally happen inside of
PyObject_GetAttrString).
I'll fix it.
Stefan
More information about the Cython-dev
mailing list