--- a/DocumentationTools/ModuleDocumentor.py Sat Jan 16 16:53:31 2016 +0100 +++ b/DocumentationTools/ModuleDocumentor.py Sat Jan 16 16:56:59 2016 +0100 @@ -975,12 +975,12 @@ paramList.append([paramName, "", []]) lastItem = paramList[-1][2] elif desc.startswith("@type"): + parts = desc.split(None, 1) if lastTag not in ["@param", "@keyparam"]: raise TagError( "{0} line must be preceded by a parameter line\n" .format(parts[0])) inTagSection = True - parts = desc.split(None, 1) lastTag = parts[0] if len(parts) < 2: raise TagError( @@ -1012,8 +1012,12 @@ returns = [parts[1]] lastItem = returns elif desc.startswith("@rtype"): + parts = desc.split(None, 1) + if lastTag not in ["@return", "@ireturn"]: + raise TagError( + "{0} line must be preceded by a return line\n" + .format(parts[0])) inTagSection = True - parts = desc.split(None, 1) lastTag = parts[0] if len(parts) < 2: raise TagError(