mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-45019: Do some cleanup related to frozen modules. (gh-28319)
There are a few things I missed in gh-27980. This is a follow-up that will make subsequent PRs cleaner. It includes fixes to tests and tools that reference the frozen modules. https://bugs.python.org/issue45019
This commit is contained in:
parent
1fc41ae870
commit
a2d8c4b81b
12 changed files with 342 additions and 140 deletions
|
@ -117,9 +117,19 @@ def list_frozen(names):
|
|||
cmd = ' '.join(args)
|
||||
print(f"{cmd} failed with exitcode {exitcode}")
|
||||
sys.exit(exitcode)
|
||||
submodules = set()
|
||||
for line in proc.stdout.splitlines():
|
||||
name = line.strip()
|
||||
names.add(name)
|
||||
if '.' in name:
|
||||
submodules.add(name)
|
||||
else:
|
||||
names.add(name)
|
||||
# Make sure all frozen submodules have a known parent.
|
||||
for name in list(submodules):
|
||||
if name.partition('.')[0] in names:
|
||||
submodules.remove(name)
|
||||
if submodules:
|
||||
raise Exception(f'unexpected frozen submodules: {sorted(submodules)}')
|
||||
|
||||
|
||||
def list_modules():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue