summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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