Skip to content

Commit 223b739

Browse files
ArmavicaricardoV94
authored andcommitted
Fix Windows build
1 parent 68d9b80 commit 223b739

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pytensor/configdefaults.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def add_compile_configvars():
348348
if sys.platform == "win32":
349349
mingw_w64_gcc = Path(sys.executable).parent / "Library/mingw-w64/bin/g++"
350350
try:
351-
rc = call_subprocess_Popen([mingw_w64_gcc, "-v"])
351+
rc = call_subprocess_Popen([str(mingw_w64_gcc), "-v"])
352352
if rc == 0:
353353
maybe_add_to_os_environ_pathlist("PATH", mingw_w64_gcc.parent)
354354
except OSError:

pytensor/utils.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,19 @@ def maybe_add_to_os_environ_pathlist(var: str, newpath: Path | str) -> None:
123123
pass
124124

125125

126-
def subprocess_Popen(command, **params):
126+
def subprocess_Popen(command: str | list[str], **params):
127127
"""
128128
Utility function to work around windows behavior that open windows.
129129
130130
:see: call_subprocess_Popen and output_subprocess_Popen
131131
"""
132132
startupinfo = None
133133
if os.name == "nt":
134-
startupinfo = subprocess.STARTUPINFO()
134+
startupinfo = subprocess.STARTUPINFO() # type: ignore[attr-defined]
135135
try:
136-
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
136+
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW # type: ignore[attr-defined]
137137
except AttributeError:
138-
startupinfo.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW
138+
startupinfo.dwFlags |= subprocess._subprocess.STARTF_USESHOWWINDOW # type: ignore[attr-defined]
139139

140140
# Anaconda for Windows does not always provide .exe files
141141
# in the PATH, they also have .bat files that call the corresponding

0 commit comments

Comments
 (0)