Avoid incomplete coverage due to Python 2 compatibility.

Moving the Python 2 code on the same line as the condition should trick the
coverage computation into treating the whole thing as a single statement,
and since the if part will be processed, it should be covered. Nasty.