PyEval_CallObject requires a tuple of args (closes #13186)

This commit is contained in:
Benjamin Peterson 2011-10-15 13:43:21 -04:00
parent 5baef6d23b
commit a7b0976c3e
4 changed files with 31 additions and 1 deletions

View file

@ -350,6 +350,19 @@ class ClassTests(unittest.TestCase):
AllTests.__delslice__ = delslice
@test_support.cpython_only
def testDelItem(self):
class A:
ok = False
def __delitem__(self, key):
self.ok = True
a = A()
# Subtle: we need to call PySequence_SetItem, not PyMapping_SetItem.
from _testcapi import sequence_delitem
sequence_delitem(a, 2)
self.assertTrue(a.ok)
def testUnaryOps(self):
testme = AllTests()