Skip to content

Commit dc0fd95

Browse files
committed
fix missing __spec__ for bootstraped builtin modules
1 parent aaa55a5 commit dc0fd95

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

graalpython/lib-graalpython/final_patches.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,12 @@
3838
# SOFTWARE.
3939

4040
import _imp
41+
import sys
4142

4243
_imp.cache_all_file_modules()
44+
45+
from importlib._bootstrap import _spec_from_module
46+
for name in ['importlib._bootstrap', 'importlib._bootstrap_external', '_descriptor']:
47+
mod = sys.modules.get(name, None)
48+
if mod:
49+
setattr(mod, '__spec__', _spec_from_module(mod))

0 commit comments

Comments
 (0)