aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_ip6.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_ip6.py')
-rw-r--r--test/test_ip6.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test_ip6.py b/test/test_ip6.py
index 6793c8b0d94..6832498dc26 100644
--- a/test/test_ip6.py
+++ b/test/test_ip6.py
@@ -30,6 +30,11 @@ from ipaddress import IPv6Network, IPv4Network
AF_INET6 = socket.AF_INET6
+try:
+ text_type = unicode
+except NameError:
+ text_type = str
+
def mk_ll_addr(mac):
euid = in6_mactoifaceid(mac)
@@ -1060,9 +1065,9 @@ class TestIPv6RD(TestIPv6ND):
def verify_prefix_info(self, reported_prefix, prefix_option):
prefix = IPv6Network(
- unicode(prefix_option.getfieldval("prefix") +
- "/" +
- str(prefix_option.getfieldval("prefixlen"))),
+ text_type(prefix_option.getfieldval("prefix") +
+ "/" +
+ text_type(prefix_option.getfieldval("prefixlen"))),
strict=False)
self.assert_equal(reported_prefix.prefix.network_address,
prefix.network_address)