From 0c346aa16c327a9613076a46fcb98518d18f22a9 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Fri, 9 Dec 2011 21:29:36 +0000 Subject: [PATCH] handle CLI EOFError svn: r18561 --- src/cli/arghandler.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cli/arghandler.py b/src/cli/arghandler.py index 0080396c0..91feea156 100644 --- a/src/cli/arghandler.py +++ b/src/cli/arghandler.py @@ -274,8 +274,12 @@ class ArgHandler(object): {'name' : fullpath}) answer = None while not answer: - answer = raw_input(_('OK to overwrite? (yes/no) ') \ - .encode(sys.getfilesystemencoding())) + try: + answer = raw_input(_('OK to overwrite? (yes/no) ') \ + .encode(sys.getfilesystemencoding())) + except EOFError: + print + sys.exit(0) if answer.upper() in ('Y', 'YES', _('YES').upper()): self.__error( _("Will overwrite the existing file: %s") % fullpath)