projects
/
quizzer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
338e808
)
Don't crash with IndexError when we run out of questions
author
W. Trevor King
<wking@tremily.us>
Tue, 5 Feb 2013 14:09:50 +0000
(09:09 -0500)
committer
W. Trevor King
<wking@tremily.us>
Tue, 5 Feb 2013 14:09:50 +0000
(09:09 -0500)
quizzer/ui/__init__.py
patch
|
blob
|
history
diff --git
a/quizzer/ui/__init__.py
b/quizzer/ui/__init__.py
index eb8682d7220a52dc1178880bb62922868c649b19..43c1502c74813288cc2b16d7e70821b1444774ed 100644
(file)
--- a/
quizzer/ui/__init__.py
+++ b/
quizzer/ui/__init__.py
@@
-11,7
+11,8
@@
class UserInterface (object):
def get_question(self):
remaining = [q for q in self.quiz if q not in self.answers]
- return remaining[0]
+ if remaining:
+ return remaining[0]
def process_answer(self, question, answer):
if question not in self.answers: