提交 223b739f authored 作者: Virgile Andreani's avatar Virgile Andreani 提交者: Ricardo Vieira

Fix Windows build

上级 68d9b808
...@@ -348,7 +348,7 @@ def add_compile_configvars(): ...@@ -348,7 +348,7 @@ def add_compile_configvars():
if sys.platform == "win32": if sys.platform == "win32":
mingw_w64_gcc = Path(sys.executable).parent / "Library/mingw-w64/bin/g++" mingw_w64_gcc = Path(sys.executable).parent / "Library/mingw-w64/bin/g++"
try: try:
rc = call_subprocess_Popen([mingw_w64_gcc, "-v"]) rc = call_subprocess_Popen([str(mingw_w64_gcc), "-v"])
if rc == 0: if rc == 0:
maybe_add_to_os_environ_pathlist("PATH", mingw_w64_gcc.parent) maybe_add_to_os_environ_pathlist("PATH", mingw_w64_gcc.parent)
except OSError: except OSError:
......
...@@ -123,7 +123,7 @@ def maybe_add_to_os_environ_pathlist(var: str, newpath: Path | str) -> None: ...@@ -123,7 +123,7 @@ def maybe_add_to_os_environ_pathlist(var: str, newpath: Path | str) -> None:
pass pass
def subprocess_Popen(command, **params): def subprocess_Popen(command: str | list[str], **params):
""" """
Utility function to work around windows behavior that open windows. Utility function to work around windows behavior that open windows.
...@@ -131,11 +131,11 @@ def subprocess_Popen(command, **params): ...@@ -131,11 +131,11 @@ def subprocess_Popen(command, **params):
""" """
startupinfo = None startupinfo = None
if os.name == "nt": if os.name == "nt":
startupinfo = subprocess.STARTUPINFO() startupinfo = subprocess.STARTUPINFO() # type: ignore[attr-defined]
try: try:
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW # type: ignore[attr-defined]
except AttributeError: except AttributeError:
startupinfo.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW startupinfo.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW # type: ignore[attr-defined]
# Anaconda for Windows does not always provide .exe files # Anaconda for Windows does not always provide .exe files
# in the PATH, they also have .bat files that call the corresponding # in the PATH, they also have .bat files that call the corresponding
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论