jenkins-bot has submitted this change and it was merged.
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(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
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: merged
Gerrit-Change-Id: Icc92280566c7d972275a5dc344f6e5567e480f9c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits