From 5a5b8975786f852e34d01da8c4caf7ed302246ac Mon Sep 17 00:00:00 2001 From: falseen Date: Thu, 10 Sep 2015 02:00:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9py3=EF=BC=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=AF=A6=E7=BB=86=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 兼容py3,显示详细错误。 --- shadowsocks/crypto/util.py | 4 ++-- shadowsocks/tcprelay.py | 4 ++-- shadowsocks/udprelay.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shadowsocks/crypto/util.py b/shadowsocks/crypto/util.py index e579455..a16baba 100644 --- a/shadowsocks/crypto/util.py +++ b/shadowsocks/crypto/util.py @@ -87,8 +87,8 @@ def find_library(possible_lib_names, search_symbol, library_name): else: logging.warn('can\'t find symbol %s in %s', search_symbol, path) - except Exception: - pass + except ValueError as e: + print(e) return None diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index cecd017..87710c1 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -707,8 +707,8 @@ class TCPRelay(object): self._closed = False self._eventloop = None self._fd_to_handlers = {} - self.server_transfer_ul = 0L - self.server_transfer_dl = 0L + self.server_transfer_ul = 0 + self.server_transfer_dl = 0 self._timeout = config['timeout'] self._timeouts = [] # a list for all the handlers diff --git a/shadowsocks/udprelay.py b/shadowsocks/udprelay.py index 3ea9b6d..315a0b0 100644 --- a/shadowsocks/udprelay.py +++ b/shadowsocks/udprelay.py @@ -873,8 +873,8 @@ class UDPRelay(object): self._dns_cache = lru_cache.LRUCache(timeout=300) self._eventloop = None self._closed = False - self.server_transfer_ul = 0L - self.server_transfer_dl = 0L + self.server_transfer_ul = 0 + self.server_transfer_dl = 0 self._sockets = set() self._fd_to_handlers = {}