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

[tor-commits] [bridgedb/master] Fix bridgedb.Tests.randomIP*() methods to return the correct IP type.



commit 97918ce31cbdc71399347bbc59dc848850f66be7
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Fri Dec 20 03:42:54 2013 +0000

    Fix bridgedb.Tests.randomIP*() methods to return the correct IP type.
---
 lib/bridgedb/Tests.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bridgedb/Tests.py b/lib/bridgedb/Tests.py
index 90726cb..881463b 100644
--- a/lib/bridgedb/Tests.py
+++ b/lib/bridgedb/Tests.py
@@ -44,13 +44,13 @@ def randomIP():
     return randomIP6()
 
 def randomIP4():
-    return ipaddr.IPAddress(random.getrandbits(32))
+    return ipaddr.IPv4Address(random.getrandbits(32))
 
 def randomIP4String():
     return str(ipaddr.IPAddress(random.getrandbits(32)))
 
 def randomIP6():
-    return ipaddr.IPAddress(random.getrandbits(128))
+    return ipaddr.IPv6Address(random.getrandbits(128))
 
 def randomIP6String():
     # as used by Tor, with enclosing []



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