OK, so you already merged it, BUT:
Don't use \ to break long lines, use () instead, e.g.

    if (not trailing_newline_in_previous_file
        and not file_text.startswith("\n"):

And if you do insist on using \, the indentation on the following line is wrong.