[python3] Solves a bunch of incompatible syntax problems (c.f. #157)