Error while compiling file #1568

Open
tzulberti-jampp opened this Issue Dec 28, 2016 · 0 comments

Projects

None yet

1 participant

@tzulberti-jampp

I have the following foo.py:

class A(object):

    class B(Exception):
        pass

    def foobar(self):
        print 'foobar'

And I have the following foo.pxd

cdef class A:
   pass

When I do python setup.py develop, I got the following error:

Exception AttributeError: "'NoneType' object has no attribute 'is_anonymous'" in 'Cython.Compiler.FlowControl.ControlFlow.is_tracked' ignored

After building cython with the --no-cython-compile flag, I got the following information when running
python setup.py develop

Compiling foo.py because it changed.
[1/1] Cythonizing foo.py

Error compiling Cython file:
------------------------------------------------------------
...

class A(object):

    class B(Exception):
   ^
------------------------------------------------------------

foo.py:48:4: Compiler crash in ControlFlowAnalysis

ModuleNode.body = StatListNode(foo.py:6:0)
CClassDefNode.body = StatListNode(foo.py:48:4)

Compiler crash traceback from this point on:
  File "/home/tzulberti/workspace/cython/Cython/Compiler/Visitor.py", line 180, in _visit
    return handler_method(obj)
  File "/home/tzulberti/workspace/cython/Cython/Compiler/FlowControl.py", line 1307, in visit_PyClassDefNode
    self.env.lookup(node.name))
  File "/home/tzulberti/workspace/cython/Cython/Compiler/FlowControl.py", line 174, in mark_assignment
    if self.block and self.is_tracked(entry):
  File "/home/tzulberti/workspace/cython/Cython/Compiler/FlowControl.py", line 152, in is_tracked
    if entry.is_anonymous:
AttributeError: 'NoneType' object has no attribute 'is_anonymous'
Traceback (most recent call last):
  File "setup.py", line 22, in <module>
    ext_modules = cythonize(ext_modules)
  File "/home/tzulberti/workspace/cython/Cython/Build/Dependencies.py", line 935, in cythonize
    cythonize_one(*args)
  File "/home/tzulberti/workspace/cython/Cython/Build/Dependencies.py", line 1057, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: foo.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment