handle CLI EOFError

svn: r18561
This commit is contained in:
Paul Franklin 2011-12-09 21:29:36 +00:00
parent 82eaf45b20
commit 0c346aa16c

View File

@ -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)