Backported to 2.7 for Buildozer