py3 compatibility fix for osx packaging

Fixes https://github.com/kivy/kivy/issues/2398.