From 680c128c72ba2e0af97d46ead389e4f857f5448d Mon Sep 17 00:00:00 2001 From: falseen Date: Fri, 25 Sep 2015 23:17:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=86=E8=8A=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复:搜索完所有路径之后再判断是否抛出错误,而不是遇到错误就抛出。主要是考虑到系统中同时存在32位和64位dll的情况,原来的代码如果第一个找到的dll文件跟系统不符的话会直接报错。 --- shadowsocks/crypto/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shadowsocks/crypto/util.py b/shadowsocks/crypto/util.py index 4deb637..212df86 100644 --- a/shadowsocks/crypto/util.py +++ b/shadowsocks/crypto/util.py @@ -87,8 +87,9 @@ def find_library(possible_lib_names, search_symbol, library_name): else: logging.warn('can\'t find symbol %s in %s', search_symbol, path) - except ValueError as e: - logging.error(e) + except Exception: + if path == paths[-1]: + raise return None