From dc70c6d359968d4bc21c66cbc4656e08ad9b91ce Mon Sep 17 00:00:00 2001 From: "Edwin Marshall (aspidites)" Date: Tue, 28 Aug 2012 01:31:23 -0400 Subject: [PATCH] - fixes issue #649, simpler alternative to pull request # 651 --- kivy/core/text/__init__.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/kivy/core/text/__init__.py b/kivy/core/text/__init__.py index 25aa8834f..157c2e793 100644 --- a/kivy/core/text/__init__.py +++ b/kivy/core/text/__init__.py @@ -396,19 +396,16 @@ class LabelBase(object): sz[1] + self.options['padding_y'] * 2 def _get_text(self): - return self._text + try: + return self._text.decode('utf8') + except AttributeError: + # python 3 support + return str(self._text) def _set_text(self, text): - if text == self._text: - return - # try to automaticly decode unicode - try: - self._text = text.decode('utf8') - except: - try: - self._text = str(text) - except: - self._text = text + if text != self._text: + self._text = text + text = property(_get_text, _set_text, doc='Get/Set the text') label = property(_get_text, _set_text, doc='Get/Set the text')