@@ -991,13 +991,13 @@ def test_translate(self):
991991 self .assertEqual (c , b'hllo' )
992992
993993 def test_sq_item (self ):
994- _testcapi = import_helper .import_module ('_testcapi ' )
994+ _testlimitedcapi = import_helper .import_module ('_testlimitedcapi ' )
995995 obj = self .type2test ((42 ,))
996996 with self .assertRaises (IndexError ):
997- _testcapi .sequence_getitem (obj , - 2 )
997+ _testlimitedcapi .sequence_getitem (obj , - 2 )
998998 with self .assertRaises (IndexError ):
999- _testcapi .sequence_getitem (obj , 1 )
1000- self .assertEqual (_testcapi .sequence_getitem (obj , 0 ), 42 )
999+ _testlimitedcapi .sequence_getitem (obj , 1 )
1000+ self .assertEqual (_testlimitedcapi .sequence_getitem (obj , 0 ), 42 )
10011001
10021002
10031003class BytesTest (BaseBytesTest , unittest .TestCase ):
@@ -1256,7 +1256,7 @@ class SubBytes(bytes):
12561256class ByteArrayTest (BaseBytesTest , unittest .TestCase ):
12571257 type2test = bytearray
12581258
1259- _testcapi = import_helper .import_module ('_testcapi ' )
1259+ _testlimitedcapi = import_helper .import_module ('_testlimitedcapi ' )
12601260
12611261 def test_getitem_error (self ):
12621262 b = bytearray (b'python' )
@@ -1354,7 +1354,7 @@ def setitem_as_mapping(b, i, val):
13541354 b [i ] = val
13551355
13561356 def setitem_as_sequence (b , i , val ):
1357- self ._testcapi .sequence_setitem (b , i , val )
1357+ self ._testlimitedcapi .sequence_setitem (b , i , val )
13581358
13591359 def do_tests (setitem ):
13601360 b = bytearray ([1 , 2 , 3 ])
@@ -1401,7 +1401,7 @@ def del_as_mapping(b, i):
14011401 del b [i ]
14021402
14031403 def del_as_sequence (b , i ):
1404- self ._testcapi .sequence_delitem (b , i )
1404+ self ._testlimitedcapi .sequence_delitem (b , i )
14051405
14061406 def do_tests (delete ):
14071407 b = bytearray (range (10 ))
@@ -1810,7 +1810,7 @@ def __index__(self):
18101810 with self .subTest ("tp_as_sequence" ):
18111811 b = bytearray (b'Now you see me...' )
18121812 with self .assertRaises (IndexError ):
1813- self ._testcapi .sequence_setitem (b , 0 , Boom ())
1813+ self ._testlimitedcapi .sequence_setitem (b , 0 , Boom ())
18141814
18151815
18161816class AssortedBytesTest (unittest .TestCase ):
0 commit comments