https://github.com/python/cpython/commit/c08a302249edba844a26e1a0231671afd92b973d
commit: c08a302249edba844a26e1a0231671afd92b973d
branch: 3.13
author: neonene <[email protected]>
committer: freakboy3742 <[email protected]>
date: 2024-07-11T06:48:53+08:00
summary:

[3.13] gh-117398: Use the correct module loader for iOS in datetime CAPI test 
(GH-120477) (#121561)

Use the correct binary module loader for iOS.

files:
M Lib/test/datetimetester.py

diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 00819fda45289f..ca804fe28b3224 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -6792,6 +6792,13 @@ def test_datetime_from_timestamp(self):
                     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
@@ -6801,7 +6808,7 @@ def test_type_check_in_subinterp(self):
                 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)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to