fix dll load bug on windows from python3.8 (#27324)

revert-27520-disable_pr
Zhou Wei 5 years ago committed by GitHub
parent d4b4357bc0
commit a7fadce82f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -39,6 +39,11 @@ try:
third_lib_path = current_path + os.sep + '..' + os.sep + 'libs'
os.environ['path'] = third_lib_path + ';' + os.environ['path']
sys.path.insert(0, third_lib_path)
# Note: from python3.8, PATH will not take effect
# https://github.com/python/cpython/pull/12302
# Use add_dll_directory to specify dll resolution path
if sys.version_info[:2] >= (3, 8):
os.add_dll_directory(third_lib_path)
except ImportError as e:
from .. import compat as cpt

Loading…
Cancel
Save