summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Evens <tievens@cisco.com>2016-03-30 16:27:47 -0700
committerTim Evens <tievens@cisco.com>2016-03-30 16:27:47 -0700
commitf456ffc8d95d04b0381dc07cf2ae113043f3c887 (patch)
treeb899ac53627c6b169ddc6e41072502e3cb30185f
parent0f78d57c604e864fab51f7cfb8fa69c9c4e623c7 (diff)
downloadkafka-python-f456ffc8d95d04b0381dc07cf2ae113043f3c887.tar.gz
Changed transltae to replace to support python 3
-rw-r--r--kafka/conn.py3
1 files changed, 2 insertions, 1 deletions
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