# HG changeset patch # User Emmanuel Gil Peyrot # Date 1575832468 -3600 # Node ID f2c3848dabff0f83c82150f19fa7d9bb13712d90 # Parent f953ae5b37320e7970c7a9c2cb5883cf60f3a501 PyTouhou: Fix text comparison to be done after encoding to bytes diff --git a/pytouhou/game/text.py b/pytouhou/game/text.py --- a/pytouhou/game/text.py +++ b/pytouhou/game/text.py @@ -116,12 +116,12 @@ class Text(GlyphCollection): def set_text(self, text): + if isinstance(text, str): + text = text.encode() + if text == self.text: return - if isinstance(text, str): - text = text.encode() - self.set_sprites([c - self.shift for c in text]) self.text = text self.changed = True