summaryrefslogtreecommitdiffstats
path: root/Tools/clinic/clinic.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/clinic/clinic.py')
-rwxr-xr-xTools/clinic/clinic.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 5480add..44456a7 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -997,7 +997,8 @@ class BlockPrinter:
# "languages" maps the name of the language ("C", "Python").
# "extensions" maps the file extension ("c", "py").
languages = { 'C': CLanguage, 'Python': PythonLanguage }
-extensions = { 'c': CLanguage, 'h': CLanguage, 'py': PythonLanguage }
+extensions = { name: CLanguage for name in "c cc cpp cxx h hh hpp hxx".split() }
+extensions['py'] = PythonLanguage
# maps strings to callables.
@@ -2430,9 +2431,6 @@ class DSLParser:
# the final stanza of the DSL is the docstring.
def state_function_docstring(self, line):
- if not self.function.self_converter:
- self.function.self_converter = self_converter("self", self.function)
-
if self.group:
fail("Function " + self.function.name + " has a ] without a matching [.")
@@ -2604,6 +2602,9 @@ class DSLParser:
if not self.function:
return
+ if not self.function.self_converter:
+ self.function.self_converter = self_converter("self", self.function)
+
if self.keyword_only:
values = self.function.parameters.values()
if not values: