fix python3 syntax errors