8000 Update stdlib modules list · emmatyping/cpython@0d7e1db · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d7e1db

Browse files
committed
Update stdlib modules list
Also update `generate_stdlib_module_names.py` to collect `compression`, a namespace package.
1 parent 586a48d commit 0d7e1db

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Python/stdlib_module_names.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/build/generate_stdlib_module_names.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,16 @@ def list_packages(names):
7070
package_path = os.path.join(STDLIB_PATH, name)
7171
if not os.path.isdir(package_path):
7272
continue
73-
if any(package_file.endswith(".py")
74-
for package_file in os.listdir(package_path)):
73+
# Walk the package directory to check if the package is a namespace
74+
has_py_files = False
75+
for root, _dirs, files in os.walk(package_path):
76+
for file in files:
77+
if file.endswith(".py"):
78+
has_py_files = True
79+
break
80+
if has_py_files:
81+
break
82+
if has_py_files:
7583
names.add(name)
7684

7785

0 commit comments

Comments
 (0)
0