提交 86815d66 authored 作者: Hector's avatar Hector 提交者: Thomas Wiecki

Explicitly add gcc dll directory on Python 3.8+ on Windows

上级 9926e07c
...@@ -286,6 +286,11 @@ def dlimport(fullpath, suffix=None): ...@@ -286,6 +286,11 @@ def dlimport(fullpath, suffix=None):
_logger.debug(f"module_name {module_name}") _logger.debug(f"module_name {module_name}")
sys.path[0:0] = [workdir] # insert workdir at beginning (temporarily) sys.path[0:0] = [workdir] # insert workdir at beginning (temporarily)
# Explicitly add gcc dll directory on Python 3.8+ on Windows
if (sys.platform == "win32") & (hasattr(os, "add_dll_directory")):
gcc_path = shutil.which("gcc")
if gcc_path is not None:
os.add_dll_directory(os.path.dirname(gcc_path))
global import_time global import_time
try: try:
importlib.invalidate_caches() importlib.invalidate_caches()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论