megahal library crashes if the text ends with ' for some reason, so work around it

This commit is contained in:
Brian S. Stephan 2010-09-13 20:22:08 -05:00
parent 1988662c0a
commit 827d1b2c86
1 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,9 @@ class MegaHAL(Module):
reply = ""
append_nick = False
if line[-1] == '\'':
line = line[:-1]
if re.search(connection.get_nickname(), line, re.IGNORECASE) is not None:
addressed_pattern = '^' + connection.get_nickname() + '[:,]\s+'
addressed_re = re.compile(addressed_pattern)