XZise has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/231502

Change subject: [FIX] interwiki: Use correct integer range
......................................................................

[FIX] interwiki: Use correct integer range

In d15e0c44 the interwiki script uses IntegerOption with the maximum being one
element larger than allowed. This is now using a ListOption as a more
appropriate choice.

Change-Id: Icc92280566c7d972275a5dc344f6e5567e480f9c
---
M scripts/interwiki.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/02/231502/1

diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index f6b4c5b..57bc1e3 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -359,7 +359,7 @@
 import pywikibot
 
 from pywikibot import config, i18n, pagegenerators, textlib, interwiki_graph, 
titletranslate
-from pywikibot.bot import IntegerOption, StandardOption
+from pywikibot.bot import ListOption, StandardOption
 from pywikibot.tools import first_upper
 
 if sys.version_info[0] > 2:
@@ -1575,13 +1575,13 @@
                 # TODO: allow answer to repeat previous or go back after a 
mistake
                 answer = pywikibot.input_choice(
                     'Which variant should be used?',
-                    (IntegerOption(maximum=len(pages) + 1),
+                    (ListOption(pages),
                      StandardOption('none', 'n'),
                      StandardOption('give up', 'g')))
                 if answer == 'g':
                     return None
                 elif answer != 'n':
-                    result[site] = pages[answer[1] - 1]
+                    result[site] = answer[1]
 
         # Loop over the ones that have one solution, so are in principle
         # not a problem.

-- 
To view, visit https://gerrit.wikimedia.org/r/231502
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc92280566c7d972275a5dc344f6e5567e480f9c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to