realistic.names shouldn't return a 0-length filename

This commit is contained in:
Wesley Spikes 2011-07-11 14:17:06 -07:00
parent 3303b0f33b
commit e4effe5479

View file

@ -123,7 +123,7 @@ def names(mean, stddev, charset=None, seed=None):
while True:
while True:
length = int(rand.normalvariate(mean, stddev))
if length >= 0:
if length > 0:
break
name = ''.join(rand.choice(charset) for _ in xrange(length))
yield name