From a2fcdecbb5e109da5568084d7acb2332af83b6f5 Mon Sep 17 00:00:00 2001 From: José Alburquerque Date: Sun, 11 Apr 2010 16:15:01 -0400 Subject: codegen/docextract.py: Stop final section processing on first match. * codegen/docextract.py (process_final_sections): Modify the final section pattern matching for loop to stop on first match so that it doesn't match both a colon return ('Returns: ...') and a no colon return ('Returns ...') which leads to annotation extraction errors. --- codegen/docextract.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codegen/docextract.py b/codegen/docextract.py index aef0393..eff8c5e 100644 --- a/codegen/docextract.py +++ b/codegen/docextract.py @@ -347,6 +347,10 @@ def process_final_sections(fp, line, cur_doc): # In case more lines need to be appended. append_func = cur_doc.append_to_description + # Stop final section pattern matching for loop since a match + # has already been found. + break + # Remove the no colon return pattern (which was temporarily added in # the just executed loop) from the list of final section patterns. final_section_patterns.pop() -- cgit