John Vandenberg has submitted this change and it was merged.
Change subject: [FIX] input_choice: get length of list copy ......................................................................
[FIX] input_choice: get length of list copy
If the parameters have been zipped with Python 3 the options are at first an zip object where len() doesn't work. So as long as list() does work on the options it's fine and we use that length then.
Change-Id: Ica95745c2bcc0490e93ae35510e95d5073f8cb94 --- M pywikibot/userinterfaces/terminal_interface_base.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/userinterfaces/terminal_interface_base.py b/pywikibot/userinterfaces/terminal_interface_base.py index e50f5b9..f86859f 100755 --- a/pywikibot/userinterfaces/terminal_interface_base.py +++ b/pywikibot/userinterfaces/terminal_interface_base.py @@ -232,9 +232,9 @@ options. If default is not a shortcut, it'll return -1. @rtype: int (if not return_shortcut), lowercased basestring (otherwise) """ + options = list(options) if len(options) == 0: raise ValueError(u'No options are given.') - options = list(options) if automatic_quit is True: options += [('Quit', 'q')] quit_index = len(options) - 1
pywikibot-commits@lists.wikimedia.org