jenkins-bot merged this change.

View Change

Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
[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(-)

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 change 513559. To unsubscribe, or for help writing mail filters, visit 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@gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa@seznam.cz>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)