Avoid 'empty range for randrage()'

This commit is contained in:
Elis Axelsson 2012-08-18 17:05:26 +02:00
parent e4fb245e36
commit f16a89ffff

View file

@ -119,7 +119,7 @@ class ponysay():
if names == None: if names == None:
names = list(ponies.keys()) names = list(ponies.keys())
return ponies[names[random.randrange(0, len(names) - 1)]] return ponies[names[random.randrange(0, len(names))]]
''' '''
Returns a list with all (pony, quote file) pairs Returns a list with all (pony, quote file) pairs