From f456ffc8d95d04b0381dc07cf2ae113043f3c887 Mon Sep 17 00:00:00 2001 From: Tim Evens Date: Wed, 30 Mar 2016 16:27:47 -0700 Subject: [PATCH] Changed transltae to replace to support python 3 --- kafka/conn.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kafka/conn.py b/kafka/conn.py index f7a85dc..0ce469d 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -374,7 +374,8 @@ def get_ip_port_afi(host_and_port_str): if host_and_port_str.strip()[0] == '[': afi = socket.AF_INET6 res = host_and_port_str.split("]:") - res[0] = res[0].translate(None, "[]") + res[0] = res[0].replace("[", "") + res[0] = res[0].replace("]", "") elif host_and_port_str.count(":") > 1: afi = socket.AF_INET6