# HG changeset patch # Parent ab05e7dd27889b93f20d97bae86170aabfe45ace diff --git a/Lib/random.py b/Lib/random.py --- a/Lib/random.py +++ b/Lib/random.py @@ -282,7 +282,7 @@ if random is None: random = self.random - for i in reversed(xrange(1, len(x))): + for i in xrange(1, len(x), -1): # pick an element in x[:i+1] with which to exchange x[i] j = int(random() * (i+1)) x[i], x[j] = x[j], x[i]