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

[tor-commits] [bridgedb/master] Change Filters.filterBridgeByIPv[46]() to use bridge.allVanillaAddresses.



commit 1ffd43fe9f14d03cf3ca49286b3b5570bc361b5d
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Wed Dec 24 08:41:42 2014 +0000

    Change Filters.filterBridgeByIPv[46]() to use bridge.allVanillaAddresses.
    
    Using bridge.or_addresses is deprecated.
---
 lib/bridgedb/Filters.py |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/bridgedb/Filters.py b/lib/bridgedb/Filters.py
index f22fcc7..1a8a8d8 100644
--- a/lib/bridgedb/Filters.py
+++ b/lib/bridgedb/Filters.py
@@ -55,8 +55,8 @@ def filterBridgesByIP4(bridge):
     except ValueError:
         pass
 
-    for k in bridge.or_addresses.keys():
-        if type(k) is IPv4Address:
+    for address, port, version in bridge.allVanillaAddresses:
+        if version == 4:
             return True
     return False
 setattr(filterBridgesByIP4, "description", "ip=4")
@@ -67,8 +67,8 @@ def filterBridgesByIP6(bridge):
     except ValueError:
         pass
 
-    for k in bridge.or_addresses.keys():
-        if type(k) is IPv6Address:
+    for address, port, version in bridge.allVanillaAddresses:
+        if version == 6:
             return True
     return False
 setattr(filterBridgesByIP6, "description", "ip=6")



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