Commit 55cf301b authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Fixed gcc warning with list comprehensions

Ticket 65
parent 213f561f
......@@ -2619,7 +2619,7 @@ class ListComprehensionAppendNode(ExprNode):
self.is_temp = 1
def generate_result_code(self, code):
code.putln("%s = PyList_Append(%s, %s); %s" %
code.putln("%s = PyList_Append(%s, (PyObject*)%s); %s" %
(self.result_code,
self.target.result_code,
self.expr.result_code,
......
u"""
>>> smoketest()
[0, 4, 8]
>>> typed()
[A, A, A]
"""
def smoketest():
print [x*2 for x in range(5) if x % 2 == 0]
cdef class A:
def __repr__(self): return "A"
def typed():
cdef A obj
print [obj for obj in [A(), A(), A()]]
\ No newline at end of file
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