3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 04:02:45 +01:00

wrap* funcs: convert input args to a list, so that pop(0) always works

This commit is contained in:
James Lu 2017-01-06 22:12:49 -08:00
parent ba330bbfac
commit d4b4cfb32e
2 changed files with 3 additions and 0 deletions

View File

@ -876,6 +876,7 @@ class Irc():
last_prefix = '+' last_prefix = '+'
orig_modes = modes.copy() orig_modes = modes.copy()
modes = list(modes)
while modes: while modes:
# PyLink mode lists come in the form [('+t', None), ('-b', '*!*@someone'), ('+l', 3)] # PyLink mode lists come in the form [('+t', None), ('-b', '*!*@someone'), ('+l', 3)]
# The +/- part is optional depending on context, and should either: # The +/- part is optional depending on context, and should either:

View File

@ -492,6 +492,8 @@ def wrapArguments(prefix, args, length, separator=' '):
buf = prefix buf = prefix
args = list(args)
while args: while args:
assert len(prefix+args[0]) <= length, \ assert len(prefix+args[0]) <= length, \
"wrapArguments: Argument %r is too long for the given length %s" % (args[0], length) "wrapArguments: Argument %r is too long for the given length %s" % (args[0], length)