From 438a0785fb47fc1ba9fe9421ed47cc9defb15922 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 9 Oct 2012 17:39:50 -0400 Subject: Fix IndexError due to unintentionally moving call out of try block --- logbot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'logbot.py') diff --git a/logbot.py b/logbot.py index 80047c7..b7cc694 100755 --- a/logbot.py +++ b/logbot.py @@ -246,8 +246,9 @@ class Logbot(SingleServerIRCBot): try: msg = msg.replace("%channel%", event.target()) except: pass msg = msg.replace("%color%", self.color(nm_to_n(event.source()))) - user_message = cgi.escape(event.arguments()[0]) - try: msg = msg.replace("%message%", html_color(user_message)) + try: + user_message = cgi.escape(event.arguments()[0]) + msg = msg.replace("%message%", html_color(user_message)) except: pass return msg -- cgit v1.2.3-70-g09d2