You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee='https://github.com/ericsnowcurrently'closed_at=<Date2021-10-05.16:02:33.592>created_at=<Date2021-09-29.17:57:04.035>labels= ['interpreter-core', 'type-bug', '3.11']
title='The frozen importer should capture info in find_spec().'updated_at=<Date2021-10-05.16:09:57.175>user='https://github.com/ericsnowcurrently'
Currently FrozenImporter (in Lib/importlib/_bootstrap.py) does minimal work in its find_spec() method. It only checks whether or not the module is frozen. However, in doing so it has gathered all the info we need to load the module. We end up repeating that work in exec_module().
Rather than duplicating that effort, we should preserve the info in spec.loader_state. This has the added benefit of aligning more closely with the division between finder and loader. Once we get to the loader, there shouldn't be a need to check if the module is frozen nor otherwise interact with the internal frozen module state (i.e. PyImport_FrozenModules).