diff -r 0572a215bd2f -r 5994b80b8760 eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py --- a/eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py Sun Apr 11 16:53:48 2021 +0200 +++ b/eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py Sun Apr 11 18:45:10 2021 +0200 @@ -757,9 +757,11 @@ for line in lineList: line = line.strip() - if returnFound is False: - if re.match(returnPattern, line): - returnFound = True + if ( + returnFound is False and + re.match(returnPattern, line) + ): + returnFound = True if returnFound: returnTmpLine += line