mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Fixed bug #941579.
This commit is contained in:
parent
2c2e21e765
commit
1638a1c796
@ -104,10 +104,13 @@ class HangmanGame:
|
||||
|
||||
def getWord(self, dbHandler):
|
||||
db = dbHandler.getDb()
|
||||
cur = db.cursor()
|
||||
cur.execute("""SELECT word FROM words ORDER BY random() LIMIT 1""")
|
||||
word = cur.fetchone()[0]
|
||||
return word.lower()
|
||||
cursor = db.cursor()
|
||||
cursor.execute("""SELECT word FROM words ORDER BY random() LIMIT 1""")
|
||||
if cursor.rowcount != 0:
|
||||
word = cursor.fetchone()[0]
|
||||
return word.lower()
|
||||
else:
|
||||
raise callbacks.Error, 'My words database is currently empty.'
|
||||
|
||||
def letterPositions(self, letter, word):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user