Revert "Some tweaks to get closer to Python 3 compat"

This reverts commit 1d7647fa857fa718af814f3038d538d758c35201.

This change altered the xml output (by forcing it to fail) which a
backward compatible change should not do. Revert it in order to get this
compat change in without breaking that output and test.

Change-Id: I20f66fb1bd9c70a0debbdd5eebacf6ec5d0f5df9
Merge "Revert "Some tweaks to get closer to Python 3 compat""