From acb3eb2910425d12f2a716d5ec5079bd14835c01 Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Tue, 21 Jun 2016 22:42:55 +0800 Subject: [PATCH] compatible python3 --- server_pool.py | 4 +++- shadowsocks/encrypt.py | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server_pool.py b/server_pool.py index c25c832..ee0cad2 100644 --- a/server_pool.py +++ b/server_pool.py @@ -123,6 +123,7 @@ class ServerPool(object): a_config['server'] = a_config['server_ipv6'] a_config['server_port'] = port a_config['max_connect'] = 128 + a_config['method'] = common.to_str(a_config['method']) try: logging.info("starting server at [%s]:%d" % (common.to_str(a_config['server']), port)) @@ -148,8 +149,9 @@ class ServerPool(object): a_config.update(user_config) a_config['server_port'] = port a_config['max_connect'] = 128 + a_config['method'] = common.to_str(a_config['method']) try: - logging.info("starting server at %s:%d" % (a_config['server'], port)) + logging.info("starting server at %s:%d" % (common.to_str(a_config['server']), port)) tcp_server = tcprelay.TCPRelay(a_config, self.dns_resolver, False) tcp_server.add_to_loop(self.loop) diff --git a/shadowsocks/encrypt.py b/shadowsocks/encrypt.py index 9609f89..e8f51b7 100644 --- a/shadowsocks/encrypt.py +++ b/shadowsocks/encrypt.py @@ -75,7 +75,6 @@ def EVP_BytesToKey(password, key_len, iv_len): class Encryptor(object): def __init__(self, key, method): self.key = key - method = common.to_str(method) self.method = method self.iv = None self.iv_sent = False