[Cython] Bug report: lambda and numpy.vectorize segfaults

Stefan Behnel stefan_ml at behnel.de
Thu Mar 24 19:29:28 CET 2011


Vitja Makarov, 24.03.2011 19:15:
> 2011/3/24 Stefan Behnel:
>> Vitja Makarov, 23.03.2011 20:11:
>>>
>>> 2011/3/23 Stefan Behnel:
>>>>
>>>> Vitja Makarov, 23.03.2011 17:25:
>>>>>
>>>>>    File "/home/vitja/tmp/cython-my-git/Cython/Compiler/Parsing.py",
>>>>> line 2307, in p_c_arg_decl
>>>>>      if 'pxd' in s.level:
>>>>> AttributeError: 'PyrexScanner' object has no attribute 'level'
>>>>
>>>> Yes it does:
>>>>
>>>> """
>>>> # Cython/Plex/Scanners.pxd
>>>> cdef class Scanner:
>>>>     [...]
>>>>     cdef public level
>>>> """
>>>>
>>>> Try a clean build.
>>>
>>> Don't actually understand what's going wrong here?
>>> I'm running plain python cython, probably I'm wrong.
>>
>> These things usually happen to me when I use e.g. a compiled Scanners.so but
>> a plain Parsing.py.
>>
>
> This is actally cython bug PyrexScanner.level attribute is not
> initialized at module scope.

Ah, right, I actually appended the test code to the existing lambda tests, 
that's why the problem didn't show.


> Simple fix is to set level to 'other' or 'unknown'

Rather 'module' or 'module_pxd', depending on the parsing context.

Stefan


More information about the cython-devel mailing list