--- a/eric6/Utilities/ModuleParser.py Sat Jul 03 11:47:48 2021 +0200 +++ b/eric6/Utilities/ModuleParser.py Sat Sep 04 11:34:54 2021 +0200 @@ -543,8 +543,9 @@ # start with zero based line after start line while lineno < len(lines): line = lines[lineno] - if line.strip(): - # line contains some text + if line.strip() and not line.lstrip().startswith("#"): + # line contains some text and does not start with + # a comment sign lineIndent = _indent(line.replace(line.lstrip(), "")) if lineIndent <= indent: return lineno