Skip to content

Commit

Permalink
Use flush for missplelling with a reason
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-berchet authored and DimitriPapadopoulos committed Dec 16, 2022
1 parent 261ad62 commit 2c5cc9e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,7 @@ def ask_for_word_fix(
r = ""
fixword = fix_case(wrongword, misspelling.data)
while not r:
print(f"{line}\t{wrongword} ==> {fixword} (Y/n) ", end="",
flush=True)
print(f"{line}\t{wrongword} ==> {fixword} (Y/n) ", end="", flush=True)
r = sys.stdin.readline().strip().upper()
if not r:
r = "Y"
Expand All @@ -716,8 +715,7 @@ def ask_for_word_fix(
for i, o in enumerate(opt):
fixword = fix_case(wrongword, o)
print(" %d) %s" % (i, fixword), end="")
print(": ", end="")
sys.stdout.flush()
print(": ", end="", flush=True)

n = sys.stdin.readline().strip()
if not n:
Expand Down

0 comments on commit 2c5cc9e

Please sign in to comment.