Fixed several Python3 syntax errors

Change-Id: I8634ddb31da0297c06e39b968ce1a209b0d78614
Merge "Fixed several Python3 syntax errors"