Commit 81c5248e authored by Stefan Behnel's avatar Stefan Behnel

don't use PyTuple_SetItem(): it differs from 'tup[i] = x' as it does not raise a TypeError

parent 1b7a9a99
...@@ -1661,8 +1661,12 @@ class IndexNode(ExprNode): ...@@ -1661,8 +1661,12 @@ class IndexNode(ExprNode):
function = "PyDict_SetItem" function = "PyDict_SetItem"
elif self.base.type is list_type: elif self.base.type is list_type:
function = "PyList_SetItem" function = "PyList_SetItem"
elif self.base.type is tuple_type: # don't use PyTuple_SetItem(), as we'd normally get a
function = "PyTuple_SetItem" # TypeError when changing a tuple, while PyTuple_SetItem()
# would allow updates
#
#elif self.base.type is tuple_type:
# function = "PyTuple_SetItem"
else: else:
function = "PyObject_SetItem" function = "PyObject_SetItem"
code.putln( code.putln(
......
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