Improve Python 3 compatibility of build scripts

These changes allow more of Chromium to be built using Python 3.

The scripts still work with Python 2.
There are no intended behaviour changes.

Bug: 941669
Change-Id: I6897d00ce00ec6aa5d7ca216b9f302e725a21897
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1527522
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
Cr-Commit-Position: refs/heads/master@{#642401}
4 files changed