Port to Python 3

Change-Id: I3ec0fd1064aa4fb3467f9881b03ce6ba4bc64458