ceph.in: do not panic at control+d in interactive mode

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2017-10-18 17:41:45 +08:00
parent 2e1e3f8b2f
commit c05060fb9b

View File

@ -539,7 +539,11 @@ def new_style_command(parsed_args, cmdargs, target, sigdict, inbuf, verbose):
import readline # noqa
while True:
interactive_input = read_input()
try:
interactive_input = read_input()
except EOFError:
# leave user an uncluttered prompt
return 0, '\n', ''
if interactive_input is None:
return 0, '', ''
cmdargs = parse_cmdargs(shlex.split(interactive_input))[2]