jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/513559 )
Change subject: [bugfix] Fix KeyError when choosing similar script
......................................................................
[bugfix] Fix KeyError when choosing similar script
ShowingListOption Option gives only one alternate assigned to script
whereas ShowingMultipleChoiceList Option is able to give multiple
results. Take into account that we have ShowingListOption here.
Bug: T224713
Change-Id: I8ddbb34dc2af640df7280f496fda1d6f3c3d198e
---
M pwb.py
1 file changed, 10 insertions(+), 11 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pwb.py b/pwb.py
index 44f95da..d75be8f 100755
--- a/pwb.py
+++ b/pwb.py
@@ -211,17 +211,16 @@
sleep(wait_time) # Wait a bit to let it be cancelled
except KeyboardInterrupt:
return None
- return scripts[script]
-
- msg = '\nThe most similar scripts are:'
- alternatives = ShowingListOption(similar_scripts, pre=msg, post='')
- try:
- prefix, script = input_choice('Which script to be run:',
- alternatives, default='1')
- except QuitKeyboardInterrupt:
- return None
- print()
- return scripts[script[0]]
+ else:
+ msg = '\nThe most similar scripts are:'
+ alternatives = ShowingListOption(similar_scripts, pre=msg, post='')
+ try:
+ prefix, script = input_choice('Which script to be run:',
+ alternatives, default='1')
+ except QuitKeyboardInterrupt:
+ return None
+ print()
+ return scripts[script]
def find_filename(filename):
--
To view, visit
https://gerrit.wikimedia.org/r/513559
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8ddbb34dc2af640df7280f496fda1d6f3c3d198e
Gerrit-Change-Number: 513559
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)