If an exception happened, it seems a bit of a contradiction for the function to return a result of true when it didn't execute successfully.
Let's repeat, slowly:
If in my second code
writeToMemoParent raises an exception
the function doesn't return normally. Because it has raised an
uncatched exception. Whatever the function's result is
doesn't matter at all since it isn't returned.
Do note, though, that if it were returned it would be the correct result because the intent of the function is to check whether the file contains
PNSN. If it were my program, in fact, I would implement just that and let all the
writeToMemoParent or whatever to the caller.