From 1222fb19a6b8712c142ad38840c68a1b237faae2 Mon Sep 17 00:00:00 2001 From: Falseen Date: Tue, 21 Mar 2017 20:15:38 +0800 Subject: [PATCH] update find_lib's name for the new openssl-1.1 dll (just for windows) (#796) the new openssl's dll(1.1) is rename to libcrypto-1_1-x64.dll and libcrypto-1_1.dll --- shadowsocks/crypto/util.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shadowsocks/crypto/util.py b/shadowsocks/crypto/util.py index de389b9..cf20e24 100644 --- a/shadowsocks/crypto/util.py +++ b/shadowsocks/crypto/util.py @@ -26,6 +26,7 @@ def find_library_nt(name): # ctypes.util.find_library just returns first result he found # but we want to try them all # because on Windows, users may have both 32bit and 64bit version installed + import glob results = [] for directory in os.environ['PATH'].split(os.pathsep): fname = os.path.join(directory, name) @@ -33,9 +34,10 @@ def find_library_nt(name): results.append(fname) if fname.lower().endswith(".dll"): continue - fname += ".dll" - if os.path.isfile(fname): - results.append(fname) + fname += "*.dll" + files = glob.glob(fname) + if files: + results.extend(files) return results