[3.13] gh-140633: AppleFrameworkLoader: Ignore AttributeError when setting __file__ (GH-140635) (GH-140659)

(cherry picked from commit 3416e7c8dc)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-10-27 14:08:09 +01:00 committed by GitHub
parent 134e2f8d7f
commit 0e3b47b839
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View file

@ -1762,7 +1762,13 @@ def create_module(self, spec):
)
# Ensure that the __file__ points at the .fwork location
try:
module.__file__ = path
except AttributeError:
# Not important enough to report.
# (The error is also ignored in _bootstrap._init_module_attrs or
# import_run_extension in import.c)
pass
return module

View file

@ -0,0 +1,2 @@
Ignore :exc:`AttributeError` when setting a module's ``__file__`` attribute
when loading an extension module packaged as Apple Framework.