Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix Argument Clinic generating the flags of the optional groups in
different order on 32-bit and 64-bit platforms.
18 changes: 9 additions & 9 deletions Modules/clinic/_cursesmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Tools/clinic/libclinic/clanguage.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ def render_option_group_parsing(
""")
continue

group_ids = {p.group for p in subset} # eliminate duplicates
# A set would eliminate duplicates too, but the iteration
# order of small negative integers depends on the platform.
group_ids = dict.fromkeys(p.group for p in subset)
d: dict[str, str | int] = {}
d['count'] = count
d['name'] = f.name
Expand All @@ -331,7 +333,7 @@ def render_option_group_parsing(
p.converter.parse_argument(parse_arguments)
d['parse_arguments'] = ", ".join(parse_arguments)

group_ids.discard(0)
group_ids.pop(0, None)
lines = "\n".join([
self.group_to_variable_name(g) + " = 1;"
for g in group_ids
Expand Down
Loading