[python3] Syntax fixes