diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index ce820560c5c..8a11e4cdcf1 100644 --- a/codespell_lib/_codespell.py +++ b/codespell_lib/_codespell.py @@ -531,8 +531,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()