You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Cython 0.25.2 on Windows 7 (x64) and found Cython to be crashing when compiling a .py file.
Reduced test to reproduce the issue
class Number: zero = 0
def main():
m1 = 1 + max(1, Number.zero)
m2 = m1
print m2
main()
Changes that makes the error disappear
If I change Number.zero to a local variable or a constant
If I change the order of parameters in max
If I remove m2 = m1
Stack trace
Error compiling Cython file:
------------------------------------------------------------
...
class Number: zero = 0
def main():
^
------------------------------------------------------------
cyerr.py:3:0: Compiler crash in AnalyseExpressionsTransform
ModuleNode.body = StatListNode(cyerr.py:1:0)
StatListNode.stats[1] = DefNode(cyerr.py:3:0,
is_cyfunction = True,
modifiers = [...]/0,
name = u'main',
py_wrapper_required = True,
reqd_kw_flags_cname = '0',
used = True)
Compiler crash traceback from this point on:
File "Cython\Compiler\Visitor.py", line 180, in Cython.Compiler.Visitor.TreeVisitor._visit (C:\projects\cython-wheels\Cython\Cython\Compiler\Visitor.c:5261)
return handler_method(obj)
File "c:\python27\lib\site-packages\Cython\Compiler\ParseTreeTransforms.py", line 2008, in visit_FuncDefNode
node.local_scope.infer_types()
File "c:\python27\lib\site-packages\Cython\Compiler\Symtab.py", line 887, in infer_types
get_type_inferer().infer_types(self)
File "c:\python27\lib\site-packages\Cython\Compiler\TypeInference.py", line 454, in infer_types
if not resolve_assignments(assignments):
File "c:\python27\lib\site-packages\Cython\Compiler\TypeInference.py", line 419, in resolve_assignments
infer_name_node_type(node)
File "c:\python27\lib\site-packages\Cython\Compiler\TypeInference.py", line 401, in infer_name_node_type
types, entry.might_overflow, entry.pos, scope)
File "c:\python27\lib\site-packages\Cython\Compiler\TypeInference.py", line 523, in safe_spanning_type
result_type = simply_type(reduce(find_spanning_type, types), pos)
File "c:\python27\lib\site-packages\Cython\Compiler\TypeInference.py", line 509, in simply_type
if result_type.is_reference:
AttributeError: 'NoneType' object has no attribute 'is_reference'
The text was updated successfully, but these errors were encountered:
I am using Cython 0.25.2 on Windows 7 (x64) and found Cython to be crashing when compiling a .py file.
Reduced test to reproduce the issue
Changes that makes the error disappear
Stack trace
The text was updated successfully, but these errors were encountered: