[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/develop] Port create_descriptors script to Python 3.



commit 66cdfa6c6e31759f4b56b98aec27be860c5b1dad
Author: Philipp Winter <phw@xxxxxxxxx>
Date:   Mon Jan 27 16:22:21 2020 -0800

    Port create_descriptors script to Python 3.
    
    ...all this required was replacing the ipaddr module with ipaddress.
---
 scripts/create_descriptors | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/create_descriptors b/scripts/create_descriptors
index ab6ea2e..0b9d26d 100755
--- a/scripts/create_descriptors
+++ b/scripts/create_descriptors
@@ -1,4 +1,4 @@
-#!/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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits