fix py27 code