extlib/megahal.py: don't crash when the input string ends in '
This commit is contained in:
parent
ae6eda2c6a
commit
c513a0bebc
|
@ -167,6 +167,10 @@ class Brain(object):
|
|||
boundary = False
|
||||
elif position == len(string):
|
||||
boundary = True
|
||||
elif (string[position] == "'" and
|
||||
string[position - 1].isalpha() and
|
||||
position + 1 == len(string)):
|
||||
boundary = True
|
||||
elif (string[position] == "'" and
|
||||
string[position - 1].isalpha() and
|
||||
string[position + 1].isalpha()):
|
||||
|
|
|
@ -59,9 +59,6 @@ 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)
|
||||
|
|
Loading…
Reference in New Issue