summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2024-06-15 00:05:30 (GMT)
committerGitHub <noreply@github.com>2024-06-15 00:05:30 (GMT)
commit5c58e728b1391c258b224fc6d88f62f42c725026 (patch)
tree3b7f8d0a63251bad56b3bb3e2f4fd7e430c70d54 /Lib/test
parent92f6d400f76b6a04dddd944568870f689c8fab5f (diff)
downloadcpython-5c58e728b1391c258b224fc6d88f62f42c725026.zip
cpython-5c58e728b1391c258b224fc6d88f62f42c725026.tar.gz
cpython-5c58e728b1391c258b224fc6d88f62f42c725026.tar.bz2
gh-117398: Use the correct module loader for iOS in datetime CAPI test. (#120477)
Use the correct loader for iOS.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/datetimetester.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 70e2e2c..e55b738 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -6786,6 +6786,13 @@ class CapiTest(unittest.TestCase):
self.assertEqual(dt_orig, dt_rt)
def test_type_check_in_subinterp(self):
+ # iOS requires the use of the custom framework loader,
+ # not the ExtensionFileLoader.
+ if sys.platform == "ios":
+ extension_loader = "AppleFrameworkLoader"
+ else:
+ extension_loader = "ExtensionFileLoader"
+
script = textwrap.dedent(f"""
if {_interpreters is None}:
import _testcapi as module
@@ -6795,7 +6802,7 @@ class CapiTest(unittest.TestCase):
import importlib.util
fullname = '_testcapi_datetime'
origin = importlib.util.find_spec('_testcapi').origin
- loader = importlib.machinery.ExtensionFileLoader(fullname, origin)
+ loader = importlib.machinery.{extension_loader}(fullname, origin)
spec = importlib.util.spec_from_loader(fullname, loader)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)