Simplify trailing whitespace stripper

Here it is python3-ified.