upgrading python code to python27 runtime