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
As of version 1497, the following bad code causes cython to fail after printing an error message.
cdef class A:
cpdef a(int allocated_rows):
pass
This produces the following output:
Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef class A:
cpdef a(int allocated_rows):
^
------------------------------------------------------------
/home/hoytak/workspace/cython-tests/temp_allocated_prob.pyx:2:10: Self argument of C method does not match parent type
Traceback (most recent call last):
File "/home/hoytak/sysroot/bin/cython", line 8, in <module>
main(command_line = 1)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 729, in main
result = compile(sources, options)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 706, in compile
return compile_multiple(source, options)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 676, in compile_multiple
result = run_pipeline(source, options)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 538, in run_pipeline
err, enddata = context.run_pipeline(pipeline, source)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 197, in run_pipeline
data = phase(data)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Main.py", line 138, in generate_pyx_code
module_node.process_implementation(options, result)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ModuleNode.py", line 70, in process_implementation
self.generate_c_code(env, options, result)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ModuleNode.py", line 263, in generate_c_code
self.body.generate_function_definitions(env, code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 323, in generate_function_definitions
stat.generate_function_definitions(env, code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 2569, in generate_function_definitions
self.entry.type.scope, code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 323, in generate_function_definitions
stat.generate_function_definitions(env, code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 1146, in generate_function_definitions
self.py_func.generate_function_definitions(env, code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 1046, in generate_function_definitions
self.body.generate_execution_code(code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/Nodes.py", line 3294, in generate_execution_code
self.value.generate_evaluation_code(code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ExprNodes.py", line 677, in generate_evaluation_code
self.generate_subexpr_evaluation_code(code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ExprNodes.py", line 465, in generate_subexpr_evaluation_code
node.generate_evaluation_code(code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ExprNodes.py", line 680, in generate_evaluation_code
self.allocate_temp_result(code)
File "/home/hoytak/sysroot/lib/python2.5/site-packages/Cython/Compiler/ExprNodes.py", line 646, in allocate_temp_result
raise RuntimeError("Temp allocated multiple times")
RuntimeError: Temp allocated multiple times
It works correctly (printing the error message and then exiting) when the cpdef is replaced by cdef. If it is replaced by def, it doesn't raise an error (separate issue?).
Hello,
As of version 1497, the following bad code causes cython to fail after printing an error message.
This produces the following output:
It works correctly (printing the error message and then exiting) when the cpdef is replaced by cdef. If it is replaced by def, it doesn't raise an error (separate issue?).
Note that this is probably related to http://trac.cython.org/cython_trac/ticket/156.
Migrated from http://trac.cython.org/ticket/165
The text was updated successfully, but these errors were encountered: