summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2023-07-29 18:47:42 (GMT)
committerGitHub <noreply@github.com>2023-07-29 18:47:42 (GMT)
commit5113ed7a2b92e8beabebe5fe2f6e856c52fbe1a0 (patch)
tree3b422bab14fe73e4142abebb4154d22f618fef82 /Tools
parent6c74b2f66957912d4202869939499864ca268e23 (diff)
downloadcpython-5113ed7a2b92e8beabebe5fe2f6e856c52fbe1a0.zip
cpython-5113ed7a2b92e8beabebe5fe2f6e856c52fbe1a0.tar.gz
cpython-5113ed7a2b92e8beabebe5fe2f6e856c52fbe1a0.tar.bz2
gh-104683: Argument clinic: pass `clinic` as a parameter where possible (#107435)
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/clinic/clinic.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 3c16dc3..defe703 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -805,7 +805,8 @@ class CLanguage(Language):
def output_templates(
self,
- f: Function
+ f: Function,
+ clinic: Clinic
) -> dict[str, str]:
parameters = list(f.parameters.values())
assert parameters
@@ -1324,7 +1325,6 @@ class CLanguage(Language):
cpp_if = "#if " + conditional
cpp_endif = "#endif /* " + conditional + " */"
- assert clinic is not None
if methoddef_define and f.full_name not in clinic.ifndef_symbols:
clinic.ifndef_symbols.add(f.full_name)
methoddef_ifndef = normalize_snippet("""
@@ -1490,7 +1490,7 @@ class CLanguage(Language):
parameters = f.render_parameters
converters = [p.converter for p in parameters]
- templates = self.output_templates(f)
+ templates = self.output_templates(f, clinic)
f_self = parameters[0]
selfless = parameters[1:]
@@ -4613,7 +4613,7 @@ class DSLParser:
self.next(self.state_terminal)
self.state(None)
- block.output.extend(self.clinic.language.render(clinic, block.signatures))
+ block.output.extend(self.clinic.language.render(self.clinic, block.signatures))
if self.preserve_output:
if block.output: