Skip to content
Myr

Merge pull request #2093 from alex-ball/patch-1

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by GitHub · parents 3737511, f31d564 · Browse files · 3 files+8 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+8 added−4 removed

  • tests:+2 added−2 removed
  • other:+6 added−2 removed

3 files+8 added−4 removed

modified:src/click/termui.py+4 added-2 removed
229 unmodified lines
230 while True:231 try:232 # Write the prompt separately so that we get nice233 # coloring through colorama on Windows234 echo(prompt, nl=False, err=err)235 value = visible_prompt_func("").lower().strip()234 echo(prompt.rstrip(" "), nl=False, err=err)235 # Echo a space to stdout to work around an issue where236 # readline causes backspace to clear the whole line.237 value = visible_prompt_func(" ").lower().strip()238 except (KeyboardInterrupt, EOFError):239 raise Abort() from None240 if value in ("y", "yes"):241 rv = True
568 unmodified lines
modified:tests/test_utils.py+2 added-2 removed
273 unmodified lines
274275 emulate_input("y\n")276 click.confirm("Prompt to stderr", err=True)277 out, err = capfd.readouterr()278 assert out == ""279 assert err == "Prompt to stderr [y/N]: "278 assert out == " "279 assert err == "Prompt to stderr [y/N]:"280281 monkeypatch.setattr(click.termui, "isatty", lambda x: True)282 monkeypatch.setattr(click.termui, "getchar", lambda: " ")283
207 unmodified lines
modified:CHANGES.rst+2 added
5 unmodified lines
6Unreleased78- Fix issue with ``Path(resolve_path=True)`` type creating invalid9 paths. :issue:`2088`10- Importing ``readline`` does not cause the ``confirm()`` prompt to11 disappear when pressing backspace. :issue:`2092`121314Version 8.0.215-------------
917 unmodified lines