Unverified Commit 66cdfa6c authored by Philipp Winter's avatar Philipp Winter
Browse files

Port create_descriptors script to Python 3.

...all this required was replacing the ipaddr module with ipaddress.
parent 86e379ff
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
#!/usr/bin/env python2.7
#!/usr/bin/env python3
#
# This file is part of BridgeDB, a Tor bridge distribution system.

@@ -6,7 +6,7 @@ import os
import random
import sys
import time
import ipaddr
import ipaddress
import math
import argparse
import hashlib
@@ -120,7 +120,7 @@ def get_hex_string(size):
def get_random_ipv6_addr():
    valid_addr = None
    while not valid_addr:
        maybe = ipaddr.IPv6Address(random.getrandbits(128))
        maybe = ipaddress.IPv6Address(random.getrandbits(128))
        valid = check_ip_validity(maybe)
        if valid:
            valid_addr = maybe