gh-114099 - Add iOS framework loading machinery. (GH-116454)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This commit is contained in:
Russell Keith-Magee 2024-03-19 20:36:19 +08:00 committed by GitHub
parent a557478987
commit 408e127159
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 302 additions and 62 deletions

View file

@ -707,13 +707,20 @@ class IncompatibleExtensionModuleRestrictionsTests(unittest.TestCase):
@unittest.skipIf(_testmultiphase is None, "test requires _testmultiphase module")
def test_incomplete_multi_phase_init_module(self):
# Apple extensions must be distributed as frameworks. This requires
# a specialist loader.
if support.is_apple_mobile:
loader = "AppleFrameworkLoader"
else:
loader = "ExtensionFileLoader"
prescript = textwrap.dedent(f'''
from importlib.util import spec_from_loader, module_from_spec
from importlib.machinery import ExtensionFileLoader
from importlib.machinery import {loader}
name = '_test_shared_gil_only'
filename = {_testmultiphase.__file__!r}
loader = ExtensionFileLoader(name, filename)
loader = {loader}(name, filename)
spec = spec_from_loader(name, loader)
''')