Commit d1ff05f2 authored by Robert Bradshaw's avatar Robert Bradshaw

del test and assignment fix

parent e46c93f1
...@@ -121,6 +121,12 @@ class MarkAssignments(CythonTransform): ...@@ -121,6 +121,12 @@ class MarkAssignments(CythonTransform):
self.visitchildren(node) self.visitchildren(node)
return node return node
def visit_DelStatNode(self, node):
for arg in node.args:
self.mark_assignment(arg, arg)
self.visitchildren(node)
return node
class MarkOverflowingArithmetic(CythonTransform): class MarkOverflowingArithmetic(CythonTransform):
# It may be possible to integrate this with the above for # It may be possible to integrate this with the above for
......
# Errors reported during code generation.
cdef int i
def f(a):
del a # error: deletion of local name not supported
del i # error: deletion of local name not supported
_ERRORS = u"""
6:52: Deletion of local or C global name not supported
7:52: Deletion of local or C global name not supported
"""
...@@ -80,3 +80,10 @@ def del_temp_slice(a): ...@@ -80,3 +80,10 @@ def del_temp_slice(a):
while a.attr: while a.attr:
del a.attr[:] del a.attr[:]
return a.attr return a.attr
def del_local(a):
"""
>>> del_local(object())
"""
del a
assert a is None # Until we have unbound locals...
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