Skip to content
Snippets Groups Projects
Commit 998f2c05 authored by nickolas360's avatar nickolas360
Browse files

Fix bug with RPL_ISUPPORT handler

Would crash if "=" was not present in an argument.
parent 580ff465
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -333,7 +333,7 @@ class IRCBot(object):
 
def _on_005_isupport(self, server, target, *args):
for arg in args[:-1]:
name, value = arg.split("=", 1)
name, value, *_ = arg.split("=", 1) + [None]
if name == "PREFIX":
modes, prefixes = value[1:].split(")", 1)
self._prefix_map = dict(zip(modes, prefixes))
Loading
Loading
Loading
Loading
@@ -383,7 +383,7 @@ class TestEvents(BaseBotTest):
 
def test_on_005_isupport(self):
self.handle_line(":sender 005 self PREFIX=(ohv)@&+ NAME=value :s")
self.handle_line(":sender 005 self A=B CHANMODES=Ib,k,f,Ccm :s")
self.handle_line(":sender 005 self NAME2 CHANMODES=Ib,k,f,Ccm :s")
self.assertEqual(self.bot._prefix_map, dict(zip("ohv", "@&+")))
self.assertEqual(self.bot._chanmodes, ("Ib", "k", "f", "Ccm"))
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment