Skip to content

Commit 77a7f46

Browse files
committed
Add verbose debug for framework loading.
1 parent 7554f65 commit 77a7f46

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

patch/Python/Python.patch

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ index 2ce5c5b64d..6e10a0c4a5 100644
131131
import pwd
132132
os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]
133133
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
134-
index f603a89f7f..d6db040d0d 100644
134+
index f603a89f7f..48463efcfc 100644
135135
--- a/Lib/importlib/_bootstrap_external.py
136136
+++ b/Lib/importlib/_bootstrap_external.py
137137
@@ -52,7 +52,7 @@
@@ -143,7 +143,7 @@ index f603a89f7f..d6db040d0d 100644
143143
_CASE_INSENSITIVE_PLATFORMS = (_CASE_INSENSITIVE_PLATFORMS_BYTES_KEY
144144
+ _CASE_INSENSITIVE_PLATFORMS_STR_KEY)
145145

146-
@@ -1705,6 +1705,59 @@
146+
@@ -1705,6 +1705,60 @@
147147
return 'FileFinder({!r})'.format(self.path)
148148

149149

@@ -194,6 +194,7 @@ index f603a89f7f..d6db040d0d 100644
194194
+
195195
+ for extension in EXTENSION_SUFFIXES:
196196
+ dylib_file = _path_join(self.frameworks_path, f"{framework_name}.framework", f"{name}{extension}")
197+
+ _bootstrap._verbose_message('Looking for Apple Framework dylib {}', dylib_file)
197198
+ if _path_isfile(dylib_file):
198199
+ loader = AppleFrameworkLoader(fullname, dylib_file, path)
199200
+ return _bootstrap.spec_from_loader(fullname, loader)
@@ -203,16 +204,14 @@ index f603a89f7f..d6db040d0d 100644
203204
# Import setup ###############################################################
204205

205206
def _fix_up_module(ns, name, pathname, cpathname=None):
206-
@@ -1752,3 +1805,9 @@
207+
@@ -1752,3 +1806,7 @@
207208
supported_loaders = _get_supported_file_loaders()
208209
sys.path_hooks.extend([FileFinder.path_hook(*supported_loaders)])
209210
sys.meta_path.append(PathFinder)
210-
+ if sys.platform == "ios":
211-
+ sys.meta_path.append(
212-
+ AppleFrameworkFinder(
213-
+ _path_join(_path_split(sys.executable)[0], "Frameworks")
214-
+ )
215-
+ )
211+
+ if sys.platform in {"ios", "tvos", "watchos"}:
212+
+ frameworks_folder = _path_join(_path_split(sys.executable)[0], "Frameworks")
213+
+ _bootstrap._verbose_message('Adding Apple Framework dylib finder at {}', frameworks_folder)
214+
+ sys.meta_path.append(AppleFrameworkFinder(frameworks_folder))
216215
diff --git a/Lib/platform.py b/Lib/platform.py
217216
index 9b9d88bf58..6fe084a3a5 100755
218217
--- a/Lib/platform.py

0 commit comments

Comments
 (0)