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
This commit is contained in:
Falseen 2017-03-21 20:15:38 +08:00 committed by mengskysama
parent 9e25cc6bb4
commit 1222fb19a6

View file

@ -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