mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
PyEval_CallObject requires a tuple of args (closes #13186)
This commit is contained in:
parent
5baef6d23b
commit
a7b0976c3e
4 changed files with 31 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue