mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
gh-116417: Add _testlimitedcapi C extension (#116419)
Add a new C extension "_testlimitedcapi" which is only built with the limited C API. Move heaptype_relative.c and vectorcall_limited.c from Modules/_testcapi/ to Modules/_testlimitedcapi/. * configure: add _testlimitedcapi test extension. * Update generate_stdlib_module_names.py. * Update make check-c-globals. Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
parent
d9ccde28c4
commit
d9bcdda39c
23 changed files with 394 additions and 109 deletions
|
|
@ -5,6 +5,10 @@ try:
|
|||
import _testcapi
|
||||
except ImportError:
|
||||
_testcapi = None
|
||||
try:
|
||||
import _testlimitedcapi
|
||||
except ImportError:
|
||||
_testlimitedcapi = None
|
||||
import struct
|
||||
import collections
|
||||
import itertools
|
||||
|
|
@ -837,12 +841,12 @@ class TestPEP590(unittest.TestCase):
|
|||
@requires_limited_api
|
||||
def test_vectorcall_limited_incoming(self):
|
||||
from _testcapi import pyobject_vectorcall
|
||||
obj = _testcapi.LimitedVectorCallClass()
|
||||
obj = _testlimitedcapi.LimitedVectorCallClass()
|
||||
self.assertEqual(pyobject_vectorcall(obj, (), ()), "vectorcall called")
|
||||
|
||||
@requires_limited_api
|
||||
def test_vectorcall_limited_outgoing(self):
|
||||
from _testcapi import call_vectorcall
|
||||
from _testlimitedcapi import call_vectorcall
|
||||
|
||||
args_captured = []
|
||||
kwargs_captured = []
|
||||
|
|
@ -858,7 +862,7 @@ class TestPEP590(unittest.TestCase):
|
|||
|
||||
@requires_limited_api
|
||||
def test_vectorcall_limited_outgoing_method(self):
|
||||
from _testcapi import call_vectorcall_method
|
||||
from _testlimitedcapi import call_vectorcall_method
|
||||
|
||||
args_captured = []
|
||||
kwargs_captured = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue