Title: Drop the "list_frozen" command from _test_embed.
Type: Stage: needs patch
Components: Demos and Tools Versions: Python 3.11
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eric.snow, vstinner
Priority: normal Keywords:

Created on 2021-09-13 23:22 by eric.snow, last changed 2021-09-15 08:23 by vstinner.

Messages (4)
msg401741 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2021-09-13 23:22
In Programs/_test_embed.c the "list_frozen" command prints out the name of each frozen module (defined in Python/frozen.c).  The only place this is used is in Tools/scripts/ (in list_frozen()).  That script can be updated to call imp._get_frozen_module_names(), which was added in PR GH-28319 for bpo-45019.  Then _test_embed can go back to being used strictly for tests.

(FWIW, the script could also read from Python/frozen_modules/MANIFEST after running "make regen-frozen".  That file was added in GH-27980).
msg401761 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-09-14 06:46
imp._get_frozen_module_names() doesn't exist. I cannot see it in GH-28319. Moreover, the imp module is now deprecated. If something is added, it should be added to the private _imp module.
msg401806 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2021-09-14 23:55
Yeah, sorry, I got the PRs mixed up.  I added it in

_imp._get_frozen_module_names() should work just fine.
msg401816 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-09-15 08:23
I found a new _imp._frozen_module_names() function:

$ ./python 
Python 3.11.0a0 (heads/main:1afc7b3219, Sep 15 2021, 10:22:28) [GCC >>> import _imp; _imp._frozen_module_names()
['_frozen_importlib', '_frozen_importlib_external', 'zipimport']
Date User Action Args
2021-09-15 08:23:50vstinnersetmessages: + msg401816
2021-09-14 23:55:07eric.snowsetmessages: + msg401806
2021-09-14 06:46:00vstinnersetmessages: + msg401761
2021-09-13 23:22:53eric.snowcreate