Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
variable has been renamed
  • Loading branch information
tiran committed Jun 29, 2022
commit f22f837e500694d8c0827414bb4d43fe92531a2d
10 changes: 3 additions & 7 deletions Tools/scripts/check_shared_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_makefile_modules(args: argparse.Namespace) -> list[ModuleInfo]:
MODSHARED_NAMES: modules in *shared* block
MODDISABLED_NAMES: modules in *disabled* block

Modules built by setup.py addext() have a MODULE_{modname} entry,
Modules built by setup.py addext() have a MODULE_{modname}_STATE entry,
but are not listed in MODSHARED_NAMES.

Modules built by old-style setup.py add() have neither a MODULE_{modname}
Expand All @@ -73,16 +73,12 @@ def get_makefile_modules(args: argparse.Namespace) -> list[ModuleInfo]:

modules = []
for key, value in sysconfig.get_config_vars().items():
if not key.startswith("MODULE_"):
continue
if key.endswith(
("_CFLAGS", "_DEPS", "_LDFLAGS", "_OBJS", "CTYPES_MALLOC_CLOSURE")
):
if not key.startswith("MODULE_") or not key.endswith("_STATE"):
continue
if value not in {"yes", "disabled", "n/a"}:
raise ValueError(f"Unsupported {value} for {key}")

modname = key[7:].lower()
modname = key[7:-6].lower()
is_builtin = modname in modbuiltin
if modname in moddisabled:
# Setup "*disabled*" rule
Expand Down
6 changes: 2 additions & 4 deletions Tools/scripts/generate_stdlib_module_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,11 @@ def list_modules_setup_extensions(names):
"""Get MODULE_{modname}={yes|disabled|n/a} entries from Makefile
"""
for key, value in sysconfig.get_config_vars().items():
if not key.startswith("MODULE_"):
continue
if key.endswith(("_CFLAGS", "_DEPS", "_LDFLAGS", "_OBJS")):
if not key.startswith("MODULE_") or not key.endswith("_STATE"):
continue
if value not in {"yes", "disabled", "n/a"}:
raise ValueError(f"Unsupported {value} for {key}")
name = key[7:].lower()
name = key[7:-6].lower()
names.add(name)


Expand Down