mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-43445: Add frozen modules to sys.stdlib_module_names (GH-24798)
Add frozen modules to sys.stdlib_module_names. For example, add "_frozen_importlib" and "_frozen_importlib_external" names. Add "list_frozen" command to Programs/_testembed.
This commit is contained in:
parent
b4f9089d4a
commit
307745aa42
5 changed files with 53 additions and 4 deletions
|
@ -1721,6 +1721,20 @@ static int test_unicode_id_init(void)
|
|||
}
|
||||
|
||||
|
||||
// List frozen modules.
|
||||
// Command used by Tools/scripts/generate_stdlib_module_names.py script.
|
||||
static int list_frozen(void)
|
||||
{
|
||||
const struct _frozen *p;
|
||||
for (p = PyImport_FrozenModules; ; p++) {
|
||||
if (p->name == NULL)
|
||||
break;
|
||||
printf("%s\n", p->name);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* *********************************************************
|
||||
* List of test cases and the function that implements it.
|
||||
|
@ -1792,6 +1806,8 @@ static struct TestCase TestCases[] = {
|
|||
{"test_audit_run_stdin", test_audit_run_stdin},
|
||||
|
||||
{"test_unicode_id_init", test_unicode_id_init},
|
||||
|
||||
{"list_frozen", list_frozen},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue