summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/test_util.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2024-03-19 12:36:19 (GMT)
committerGitHub <noreply@github.com>2024-03-19 12:36:19 (GMT)
commit408e127159e54d87bb3464fd8bd60219dc527fac (patch)
tree055bc39042521f314a7d225a22b3ca8ce403d453 /Lib/test/test_importlib/test_util.py
parenta5574789876987b2b9aa19294c735fe795a5b5c4 (diff)
downloadcpython-408e127159e54d87bb3464fd8bd60219dc527fac.zip
cpython-408e127159e54d87bb3464fd8bd60219dc527fac.tar.gz
cpython-408e127159e54d87bb3464fd8bd60219dc527fac.tar.bz2
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>
Diffstat (limited to 'Lib/test/test_importlib/test_util.py')
-rw-r--r--Lib/test/test_importlib/test_util.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/test_importlib/test_util.py b/Lib/test/test_importlib/test_util.py
index a092868..a6a76e5 100644
--- a/Lib/test/test_importlib/test_util.py
+++ b/Lib/test/test_importlib/test_util.py
@@ -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)
''')