From 23fea5e329d74c9e2d20604a7777e4ada18a23e3 Mon Sep 17 00:00:00 2001 From: AkaneAkaza Date: Tue, 21 Nov 2017 12:58:28 +0800 Subject: [PATCH] fix str type --- server_pool.py | 2 +- shadowsocks/server.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server_pool.py b/server_pool.py index b96bfeb..fcf6caf 100644 --- a/server_pool.py +++ b/server_pool.py @@ -117,7 +117,7 @@ class ServerPool(object): else: a_config = self.config.copy() a_config.update(user_config) - if len(a_config['server_ipv6']) > 2 and a_config['server_ipv6'][0] == "[" and a_config['server_ipv6'][-1] == "]": + if len(a_config['server_ipv6']) > 2 and a_config['server_ipv6'][0] == b"[" and a_config['server_ipv6'][-1] == b"]": a_config['server_ipv6'] = a_config['server_ipv6'][1:-1] a_config['server'] = common.to_str(a_config['server_ipv6']) a_config['server_port'] = port diff --git a/shadowsocks/server.py b/shadowsocks/server.py index 9af80d7..dced0a3 100755 --- a/shadowsocks/server.py +++ b/shadowsocks/server.py @@ -108,8 +108,8 @@ def main(): (protocol, password, method, obfs, obfs_param)) if 'server_ipv6' in a_config: try: - if len(a_config['server_ipv6']) > 2 and a_config['server_ipv6'][0] == "[" and a_config['server_ipv6'][ - -1] == "]": + if len(a_config['server_ipv6']) > 2 and a_config['server_ipv6'][0] == b"[" and a_config['server_ipv6'][ + -1] == b"]": a_config['server_ipv6'] = a_config['server_ipv6'][1:-1] a_config['server_port'] = int(port) a_config['password'] = password