From 538c843ec704fea18107f875aad0e14eebd1875e Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 10 Feb 2011 11:49:25 +0100 Subject: [PATCH] Remove a useless UnicodeError check --- src/room.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/room.py b/src/room.py index 1613ecee..9bb9f721 100644 --- a/src/room.py +++ b/src/room.py @@ -59,22 +59,14 @@ class Room(TextBuffer): Set the tab color and returns the txt color """ color = theme.COLOR_NORMAL_TEXT - if not time and nickname and nickname != self.own_nick and self.joined: # do the highlight - try: - if self.own_nick in txt: - self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) - color = theme.COLOR_HIGHLIGHT_TEXT - except UnicodeDecodeError: - try: - if self.own_nick in txt: - self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) - color = theme.COLOR_HIGHLIGHT_TEXT - except: - pass + if not time and nickname and nickname != self.own_nick and self.joined: + if self.own_nick in txt: + self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) + color = theme.COLOR_HIGHLIGHT_TEXT else: highlight_words = config.get('highlight_on', '').split(':') for word in highlight_words: - if word.lower() in txt.lower() and word != '': + if word and word.lower() in txt.lower(): self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) color = theme.COLOR_HIGHLIGHT_TEXT break