8000 gh-108494: Argument Clinic: fix option group for Limited C API by vstinner · Pull Request #108574 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-108494: Argument Clinic: fix option group for Limited C API #108574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 29, 2023
Merged
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
pass limited_capi, not clinic
  • Loading branch information
vstinner committed Aug 28, 2023
commit 37e2667209ca42a3f0a66fadf61e83c94de48188
7 changes: 4 additions & 3 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1664,9 +1664,9 @@ def group_to_variable_name(group: int) -> str:

def render_option_group_parsing(
self,
clinic: Clinic,
f: Function,
template_dict: TemplateDict,
limited_capi: bool,
) -> None:
# positional only, grouped, optional arguments!
# can be optional on the left or right.
Expand Down Expand Up @@ -1714,7 +1714,7 @@ def render_option_group_parsing(
count_min = sys.maxsize
count_max = -1

if clinic.limited_capi:
if limited_capi:
nargs = 'PyTuple_Size(args)'
else:
nargs = 'PyTuple_GET_SIZE(args)'
Expand Down Expand Up @@ -1875,7 +1875,8 @@ def render_function(
template_dict['unpack_max'] = str(unpack_max)

if has_option_groups:
self.render_option_group_parsing(clinic, f, template_dict)
self.render_option_group_parsing(f, template_dict,
limited_capi=clinic.limited_capi)

# buffers, not destination
for name, destination in clinic.destination_buffers.items():
Expand Down
0