Commit 736e7bda authored by Robert Bradshaw's avatar Robert Bradshaw

Merge pull request #469 from linkmauve/check-cclass-define

Don’t crash when a C class isn’t defined in the pxd
parents 80088661 6f83687d
......@@ -2191,6 +2191,8 @@ class AlignFunctionDefinitions(CythonTransform):
if pxd_def is None:
pxd_def = self.scope.lookup(node.class_name)
if pxd_def:
if not pxd_def.defined_in_pxd:
return node
outer_scope = self.scope
self.scope = pxd_def.type.scope
self.visitchildren(node)
......
# mode: error
cdef class Test
# mode: error
class Test(object):
pass
_ERRORS = u"""
3:5: C class 'Test' is declared but not defined
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment