@@ -991,13 +991,13 @@ def test_translate(self):
991
991
self .assertEqual (c , b'hllo' )
992
992
993
993
def test_sq_item (self ):
994
- _testcapi = import_helper .import_module ('_testcapi ' )
994
+ _testlimitedcapi = import_helper .import_module ('_testlimitedcapi ' )
995
995
obj = self .type2test ((42 ,))
996
996
with self .assertRaises (IndexError ):
997
- _testcapi .sequence_getitem (obj , - 2 )
997
+ _testlimitedcapi .sequence_getitem (obj , - 2 )
998
998
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 )
1001
1001
1002
1002
1003
1003
class BytesTest (BaseBytesTest , unittest .TestCase ):
@@ -1256,7 +1256,7 @@ class SubBytes(bytes):
1256
1256
class ByteArrayTest (BaseBytesTest , unittest .TestCase ):
1257
1257
type2test = bytearray
1258
1258
1259
- _testcapi = import_helper .import_module ('_testcapi ' )
1259
+ _testlimitedcapi = import_helper .import_module ('_testlimitedcapi ' )
1260
1260
1261
1261
def test_getitem_error (self ):
1262
1262
b = bytearray (b'python' )
@@ -1354,7 +1354,7 @@ def setitem_as_mapping(b, i, val):
1354
1354
b [i ] = val
1355
1355
1356
1356
def setitem_as_sequence (b , i , val ):
1357
- self ._testcapi .sequence_setitem (b , i , val )
1357
+ self ._testlimitedcapi .sequence_setitem (b , i , val )
1358
1358
1359
1359
def do_tests (setitem ):
1360
1360
b = bytearray ([1 , 2 , 3 ])
@@ -1401,7 +1401,7 @@ def del_as_mapping(b, i):
1401
1401
del b [i ]
1402
1402
1403
1403
def del_as_sequence (b , i ):
1404
- self ._testcapi .sequence_delitem (b , i )
1404
+ self ._testlimitedcapi .sequence_delitem (b , i )
1405
1405
1406
1406
def do_tests (delete ):
1407
1407
b = bytearray (range (10 ))
@@ -1810,7 +1810,7 @@ def __index__(self):
1810
1810
with self .subTest ("tp_as_sequence" ):
1811
1811
b = bytearray (b'Now you see me...' )
1812
1812
with self .assertRaises (IndexError ):
1813
- self ._testcapi .sequence_setitem (b , 0 , Boom ())
1813
+ self ._testlimitedcapi .sequence_setitem (b , 0 , Boom ())
1814
1814
1815
1815
1816
1816
class AssortedBytesTest (unittest .TestCase ):
0 commit comments