Ticket #329 (closed defect: fixed)
gil checks in .pxd files cannot rely on type information
| Reported by: | scoder | Owned by: | dagss |
|---|---|---|---|
| Priority: | major | Milestone: | 0.12 |
| Component: | Parsing | Keywords: | |
| Cc: |
Description
According to Ondrej Certik, this currently fails in cython-unstable when written in a .pxd file:
cdef BiFormFnVol BF_SYM = <BiFormFnVol> 1
http://thread.gmane.org/gmane.comp.python.cython.devel/6319/focus=6324
Error traceback:
Error converting Pyrex file to C:
------------------------------------------------------------
...
ctypedef scalar (*BiFormFnVol)(RealFunction *fu, RealFunction *fv,
RefMap *ru, RefMap *rv)
ctypedef scalar (*LiFormFnVol)(RealFunction *fv, RefMap *rv)
cdef BiFormFnVol BF_SYM = <BiFormFnVol> 1
^
------------------------------------------------------------
/home/ondrej/repos/hermes2d/python/hermes2d/_hermes2d.pxd:110:30:
Compiler crash in GilCheck
ModuleNode.body = StatListNode(_hermes2d.pxd:1:0)
StatListNode.stats[5] = CDefExternNode(_hermes2d.pxd:31:5,
include_file = 'hermes2d.h')
CDefExternNode.body = StatListNode(_hermes2d.pxd:34:4)
StatListNode.stats[5] = SingleAssignmentNode(_hermes2d.pxd:110:9)
SingleAssignmentNode.rhs = TypecastNode(_hermes2d.pxd:110:30)
File 'ExprNodes.py', line 4006, in gil_check: TypecastNode(_hermes2d.pxd:110:30)
Compiler crash traceback from this point on:
File "/home/ondrej/usr/lib/python/Cython/Compiler/ExprNodes.py",
line 4007, in gil_check
if self.type.is_pyobject and self.is_temp:
AttributeError: 'NoneType' object has no attribute 'is_pyobject'
The only reason (that I can see) to do gil checks in a .pxd file is for inline/buffer functions.
Change History
Note: See
TracTickets for help on using
tickets.
