Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c08a302

Browse filesBrowse files
authored
[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.
1 parent 5bb1175 commit c08a302
Copy full SHA for c08a302

File tree

1 file changed

+8
-1
lines changed
Filter options

1 file changed

+8
-1
lines changed

‎Lib/test/datetimetester.py

Copy file name to clipboardExpand all lines: Lib/test/datetimetester.py
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6792,6 +6792,13 @@ def test_datetime_from_timestamp(self):
67926792
self.assertEqual(dt_orig, dt_rt)
67936793

67946794
def test_type_check_in_subinterp(self):
6795+
# iOS requires the use of the custom framework loader,
6796+
# not the ExtensionFileLoader.
6797+
if sys.platform == "ios":
6798+
extension_loader = "AppleFrameworkLoader"
6799+
else:
6800+
extension_loader = "ExtensionFileLoader"
6801+
67956802
script = textwrap.dedent(f"""
67966803
if {_interpreters is None}:
67976804
import _testcapi as module
@@ -6801,7 +6808,7 @@ def test_type_check_in_subinterp(self):
68016808
import importlib.util
68026809
fullname = '_testcapi_datetime'
68036810
origin = importlib.util.find_spec('_testcapi').origin
6804-
loader = importlib.machinery.ExtensionFileLoader(fullname, origin)
6811+
loader = importlib.machinery.{extension_loader}(fullname, origin)
68056812
spec = importlib.util.spec_from_loader(fullname, loader)
68066813
module = importlib.util.module_from_spec(spec)
68076814
spec.loader.exec_module(module)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.