Gracefully handle ctrl-d, and don't exit on blank command.

This commit is contained in:
Sadrul Habib Chowdhury 2008-02-10 11:39:29 +00:00
parent 47406335ac
commit ca3f08690e
1 changed files with 7 additions and 3 deletions

View File

@ -291,9 +291,13 @@ class NullUI:
readline.read_init_file()
while True:
inp = raw_input("> ")
if len(inp) == 0: break
inp = inp.strip().split(" ")
try:
inp = raw_input("> ").strip()
except:
inp = 'quit'
if len(inp) == 0: continue
inp = inp.split(" ")
print ""
cmd = inp[0]