`unicode` is not defined on py3 so this won't work there. Also, in py3 this is already unicode so there's no reason to convert it to unicode.The special code only needs to be run on py2 because in py3 it seems os.environ is already unicode. You might want to use the `kivy.compat.PY2` for this.