diff options
-rwxr-xr-x | kpov_judge/kpov_random_helpers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kpov_judge/kpov_random_helpers.py b/kpov_judge/kpov_random_helpers.py index 775bd69..ef6d68c 100755 --- a/kpov_judge/kpov_random_helpers.py +++ b/kpov_judge/kpov_random_helpers.py @@ -13,7 +13,7 @@ import glob def alnum_gen(r, l=1): s = u"" for i in xrange(l): - s += random.choice(string.ascii_letters + string.digits) + s += r.choice(string.ascii_letters + string.digits) return s def fortune(r, max_len): @@ -67,7 +67,7 @@ def IPv4_net_gen(r, min_hosts=254, local=True, multicast=False): def IPv4_addr_gen(r, network, n_generated=1): net, mask = _net_to_int(network) hosts = [] - l = random.sample(xrange(1, 2**(32 - mask)-1), n_generated) + l = r.sample(xrange(1, 2**(32 - mask)-1), n_generated) for i in l: hosts.append(socket.inet_ntoa(struct.pack('>I', net | i))) return hosts |