[tor-commits] [bridgedb/master] Fix bridgedb.Tests.randomIP*() methods to return the correct IP type.
isis at torproject.org
isis at torproject.org
Sun Jan 12 06:06:35 UTC 2014
commit 97918ce31cbdc71399347bbc59dc848850f66be7
Author: Isis Lovecruft <isis at torproject.org>
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 []
More information about the tor-commits
mailing list