From 579838e1ba4c7a45f6e8f6cf7f0b07f35a14fd35 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 15 Aug 2015 20:02:07 -0700 Subject: [PATCH] utils.applyModes: be more error tolerant? --- utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 4fc6890..db02ff4 100644 --- a/utils.py +++ b/utils.py @@ -241,7 +241,10 @@ def applyModes(irc, target, changedmodes): log.debug('(%s) Applying modes %r on %s (initial modelist: %s)', irc.name, changedmodes, target, modelist) for mode in changedmodes: # Chop off the +/- part that parseModes gives; it's meaningless for a mode list. - real_mode = (mode[0][1], mode[1]) + try: + real_mode = (mode[0][1], mode[1]) + except IndexError: + real_mode = mode if not usermodes: pmode = '' for m in ('owner', 'admin', 'op', 'halfop', 'voice'):