diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index 8103e1ea1b4..8daca5bb4d1 100644 --- a/codespell_lib/_codespell.py +++ b/codespell_lib/_codespell.py @@ -551,8 +551,8 @@ def ask_for_word_fix(line, wrongword, misspelling, interactivity): opt = [w.strip() for w in misspelling.data.split(',')] while not r: print("%s Choose an option (blank for none): " % line, end='') - for i in range(len(opt)): - fixword = fix_case(wrongword, opt[i]) + for i, o in enumerate(opt): + fixword = fix_case(wrongword, o) print(" %d) %s" % (i, fixword), end='') print(": ", end='') sys.stdout.flush()