Arfrever Frehtes Taifersar Arahesis, 19.12.2010 15:39:
> $ wget http://www.tortall.net/projects/yasm/releases/yasm-1.1.0.tar.gz
> ...
> $ tar -xzf yasm-1.1.0.tar.gz
> $ cd yasm-1.1.0
> $ ./configure --enable-python --enable-python-bindings
> ...
> $ make
> ...
> /usr/bin/python -c "from Cython.Compiler.Main import main;
> main(command_line=1)" \
> -o yasm_python.c yasm.pyx
> Traceback (most recent call last):
> [...]
> File "/usr/lib64/python2.7/site-packages/Cython/Compiler/Nodes.py", line
> 3249, in analyse_declarations
> self.body.analyse_declarations(scope)
> File "/usr/lib64/python2.7/site-packages/Cython/Compiler/Nodes.py", line
> 346, in analyse_declarations
> stat.analyse_declarations(env)
> File "/usr/lib64/python2.7/site-packages/Cython/Compiler/Nodes.py", line
> 1999, in analyse_declarations
> self.analyse_signature(env)
> File "/usr/lib64/python2.7/site-packages/Cython/Compiler/Nodes.py", line
> 2097, in analyse_signature
> arg.hdr_type = sig.fixed_arg_type(i)
> File "/usr/lib64/python2.7/site-packages/Cython/Compiler/TypeSlots.py",
> line 100, in fixed_arg_type
> return self.format_map[self.fixed_arg_format[i]]
> KeyError: 'T'
>
> This problem doesn't occur with Cython 0.13.
> Is it a bug in Cython 0.14 or in Yasm?
Both, I'd say. The crash is in line 100 of yasm.pyx, where it says:
cdef class __assoc_data_callback:
cdef yasm_assoc_data_callback *cb
def __new__(self, destroy, print_): # <=== HERE
self.cb = <yasm_assoc_data_callback *> \
malloc(sizeof(yasm_assoc_data_callback))
self.cb.destroy = <void (*) (void *)>PyCObject_AsVoidPtr(destroy)
#self.cb.print_ = <void (*) (void *, FILE *, int)> \
PyCObject_AsVoidPtr(print_)
The "__new__" method must be called "__cinit__".
Without closer investigation, I suspect that the relevant change in Cython
0.14 is that it knows about "__new__" being a staticmethod. However, for
cdef classes is silently translates "__new__" into "__cinit__" internally.
It seems like both don't work together.
Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev