backport to python2.7 for mobile platform