mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 12:12:53 +01:00
utils.applyModes: be more error tolerant?
This commit is contained in:
parent
dd91b7e5a0
commit
579838e1ba
3
utils.py
3
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)
|
log.debug('(%s) Applying modes %r on %s (initial modelist: %s)', irc.name, changedmodes, target, modelist)
|
||||||
for mode in changedmodes:
|
for mode in changedmodes:
|
||||||
# Chop off the +/- part that parseModes gives; it's meaningless for a mode list.
|
# Chop off the +/- part that parseModes gives; it's meaningless for a mode list.
|
||||||
|
try:
|
||||||
real_mode = (mode[0][1], mode[1])
|
real_mode = (mode[0][1], mode[1])
|
||||||
|
except IndexError:
|
||||||
|
real_mode = mode
|
||||||
if not usermodes:
|
if not usermodes:
|
||||||
pmode = ''
|
pmode = ''
|
||||||
for m in ('owner', 'admin', 'op', 'halfop', 'voice'):
|
for m in ('owner', 'admin', 'op', 'halfop', 'voice'):
|
||||||
|
Loading…
Reference in New Issue
Block a user