Fix CRT DLL loading on Windows in Python 3.6
ctypes.util.find_library("c") returns None in Python 3.6. Change-Id: I1918ae53a8712220b973edfdcdcd54e612f21c94 Closes-Bug: #1785467
This commit is contained in:
parent
f9c15d2214
commit
0368124b54
@ -18,13 +18,17 @@ import ctypes.util
|
|||||||
import struct
|
import struct
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
clib_path = ctypes.util.find_library("c")
|
||||||
|
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
openssl_lib_path = "libeay32.dll"
|
openssl_lib_path = "libeay32.dll"
|
||||||
|
if clib_path is None:
|
||||||
|
clib_path = ctypes.util.find_library("ucrtbase")
|
||||||
else:
|
else:
|
||||||
openssl_lib_path = ctypes.util.find_library("ssl")
|
openssl_lib_path = ctypes.util.find_library("ssl")
|
||||||
|
|
||||||
openssl = ctypes.CDLL(openssl_lib_path)
|
openssl = ctypes.CDLL(openssl_lib_path)
|
||||||
clib = ctypes.CDLL(ctypes.util.find_library("c"))
|
clib = ctypes.CDLL(clib_path)
|
||||||
|
|
||||||
|
|
||||||
class RSA(ctypes.Structure):
|
class RSA(ctypes.Structure):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user