I can\'t see why this won\'t work. I am performing lstrip() on the string being passed to the function, and trying to see if it starts with \"\"\". For some reason, it gets caug
You haven't provided and exit path from the recursive loop. A return statement should do the trick.
(...) while True: if line.rstrip().endswith('"""'): line = infile.readline() return find_comment(infile, line) else: line = infile.readline()