projects
/
quizzer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
31a3708
)
Catch EOFError (control-d) in CommandLineInterface input() call
author
W. Trevor King
<wking@tremily.us>
Tue, 5 Feb 2013 15:16:26 +0000
(10:16 -0500)
committer
W. Trevor King
<wking@tremily.us>
Tue, 5 Feb 2013 15:16:26 +0000
(10:16 -0500)
quizzer/ui/cli.py
patch
|
blob
|
history
diff --git
a/quizzer/ui/cli.py
b/quizzer/ui/cli.py
index 52b6a8328be9b9d4a6af7337445df620108d1ff6..a82843fd71252daae3786fcdde9237b6aee7d11c 100644
(file)
--- a/
quizzer/ui/cli.py
+++ b/
quizzer/ui/cli.py
@@
-9,7
+9,10
@@
class CommandLineInterface (UserInterface):
break
print(question.prompt)
while True:
- answer = input('? ')
+ try:
+ answer = input('? ')
+ except EOFError:
+ answer = 'quit'
a = answer.strip().lower()
if a in ['q', 'quit']:
print()