From d4b4cfb32ed77952a6329173e429aa7b01b18b0c Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 6 Jan 2017 22:12:49 -0800 Subject: [PATCH] wrap* funcs: convert input args to a list, so that pop(0) always works --- classes.py | 1 + utils.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/classes.py b/classes.py index 20de11e..a407194 100644 --- a/classes.py +++ b/classes.py @@ -876,6 +876,7 @@ class Irc(): last_prefix = '+' orig_modes = modes.copy() + modes = list(modes) while modes: # PyLink mode lists come in the form [('+t', None), ('-b', '*!*@someone'), ('+l', 3)] # The +/- part is optional depending on context, and should either: diff --git a/utils.py b/utils.py index febd3a9..4b67576 100644 --- a/utils.py +++ b/utils.py @@ -492,6 +492,8 @@ def wrapArguments(prefix, args, length, separator=' '): buf = prefix + args = list(args) + while args: assert len(prefix+args[0]) <= length, \ "wrapArguments: Argument %r is too long for the given length %s" % (args[0], length)