Skip to content
Myr

Merge pull request #1020 from d-ganchar/bug/795

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

path validation bug

authored by Dan Sully · committed by GitHub · parents c914686, ad91a6e · Browse files · 1 file+5 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

1 file+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:click/termui.py+5 added-4 removed
6 unmodified lines
7from ._compat import raw_input, text_type, string_types, \8 isatty, strip_ansi, get_winterm_size, DEFAULT_COLUMNS, WIN9from .utils import echo10from .exceptions import Abort, UsageError11from .types import convert_type, Choice11from .types import convert_type, Choice, Path12from .globals import resolve_color_default131415# The prompt functions to use. The doc tools currently override these
99 unmodified lines
115 while 1:116 value = prompt_func(prompt)117 if value:118 break119 # If a default is set and used, then the confirmation120 # prompt is always skipped because that's the only thing121 # that really makes sense.119 elif default is not None:120 if isinstance(value_proc, Path):121 # validate Path default value(exists, dir_okay etc.)122 value = default123 break124 return default125 try:126 result = value_proc(value)127 except UsageError as e:
475 unmodified lines