Skip to content

Commit

Permalink
argument-clinic: Simplify multi-line string handling (GH-17852)
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 authored and pablogsal committed Jan 6, 2020
1 parent ee94bdb commit 5136e72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,14 +1182,14 @@ def render_option_group_parsing(self, f, template_dict):
lines = [self.group_to_variable_name(g) + " = 1;" for g in group_ids]
lines = "\n".join(lines)

s = """
s = """\
case {count}:
if (!PyArg_ParseTuple(args, "{format_units}:{name}", {parse_arguments})) {{
goto exit;
}}
{group_booleans}
break;
"""[1:]
"""
s = linear_format(s, group_booleans=lines)
s = s.format_map(d)
add(s)
Expand Down

0 comments on commit 5136e72

Please sign in to comment.