On Sat, Nov 13, 2010 at 10:22 AM, Vineet Jain <[email protected]> wrote:
> I'm trying to use a struct defintion declared in another package:
>
> import PriceDBCython as PriceDBCython
> cimport PriceDBCython as PriceDBCython
>
> def transform():
>    cdef i, numRows
>    cdef PriceDBCython.PriceRow * dataRowsCython
>
>
> Here is the traceback:
>
>
> def transform():
>    cdef i, numRows
>    cdef PriceDBCython.PriceRow * dataRowsCython
>        ^
> ------------------------------------------------------------
>
> /host/trading/pytrade/scripts/transformsqlitedb/transformdbcython.pyx:47:9:
> 'PriceRow' is not a type identifier
>
> Error converting Pyrex file to C:
> ------------------------------------------------------------
> ...
>    numpy.float32_t close
>    numpy.float32_t volume
>    numpy.float32_t bid
>    numpy.float32_t offer
>
> def transform():
> ^
> ------------------------------------------------------------
>
> /host/trading/pytrade/scripts/transformsqlitedb/transformdbcython.pyx:45:0:
> Compiler crash in IntroduceBufferAuxiliaryVars
>
> ModuleNode.body = StatListNode(transformdbcython.pyx:3:0)
> StatListNode.stats[22] = StatListNode(transformdbcython.pyx:45:0)
> StatListNode.stats[0] = DefNode(transformdbcython.pyx:45:0,
>    modifiers = [...]/0,
>    name = u'transform',
>    reqd_kw_flags_cname = '0')
>
> Compiler crash traceback from this point on:
>  File "Visitor.py", line 179, in
> Cython.Compiler.Visitor.TreeVisitor.visitchild
> (/tmp/easy_install-jnjvFc/Cython-0.13/Cython/Compiler/Visitor.c:3407)
>  File "Visitor.py", line 28, in
> Cython.Compiler.Visitor.BasicVisitor.visit
> (/tmp/easy_install-jnjvFc/Cython-0.13/Cython/Compiler/Visitor.c:1178)
>  File 
> "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-x86_64.egg/Cython/Compiler/Buffer.py",
> line 106, in visit_FuncDefNode
>    self.handle_scope(node, node.local_scope)
>  File 
> "/usr/local/lib/python2.6/dist-packages/Cython-0.13-py2.6-linux-x86_64.egg/Cython/Compiler/Buffer.py",
> line 61, in handle_scope
>    if entry.type.dtype.is_ptr:
> AttributeError: 'NoneType' object has no attribute 'is_ptr'
> building 'transformdbcython' extension
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
> -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c
> transformdbcython.c -o build/temp.linux-x86_64-2.6/transformdbcython.o
> transformdbcython.c:1: error: #error Do not use this file, it is the
> result of a failed Cython compilation.
> error: command 'gcc' failed with exit status 1
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>

Thanks for the report. Can you try placing the cimport first? (Though
it shouldn't matter, currently it does.) In either case, it shouldn't
be crashing--we'll look into this.

- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to