Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5113ed7

Browse filesBrowse files
authored
gh-104683: Argument clinic: pass clinic as a parameter where possible (#107435)
1 parent 6c74b2f commit 5113ed7
Copy full SHA for 5113ed7

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎Tools/clinic/clinic.py

Copy file name to clipboardExpand all lines: Tools/clinic/clinic.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,8 @@ def docstring_for_c_string(
805805

806806
def output_templates(
807807
self,
808-
f: Function
808+
f: Function,
809+
clinic: Clinic
809810
) -> dict[str, str]:
810811
parameters = list(f.parameters.values())
811812
assert parameters
@@ -1324,7 +1325,6 @@ def parser_body(
13241325
cpp_if = "#if " + conditional
13251326
cpp_endif = "#endif /* " + conditional + " */"
13261327

1327-
assert clinic is not None
13281328
if methoddef_define and f.full_name not in clinic.ifndef_symbols:
13291329
clinic.ifndef_symbols.add(f.full_name)
13301330
methoddef_ifndef = normalize_snippet("""
@@ -1490,7 +1490,7 @@ def render_function(
14901490
parameters = f.render_parameters
14911491
converters = [p.converter for p in parameters]
14921492

1493-
templates = self.output_templates(f)
1493+
templates = self.output_templates(f, clinic)
14941494

14951495
f_self = parameters[0]
14961496
selfless = parameters[1:]
@@ -4613,7 +4613,7 @@ def parse(self, block: Block) -> None:
46134613
self.next(self.state_terminal)
46144614
self.state(None)
46154615

4616-
block.output.extend(self.clinic.language.render(clinic, block.signatures))
4616+
block.output.extend(self.clinic.language.render(self.clinic, block.signatures))
46174617

46184618
if self.preserve_output:
46194619
if block.output:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.