Skip to content

Commit 09576cf

Browse files
mark-thmricardoV94
authored andcommitted
Only invoke config.cxx if non-empty
1 parent 4e5570d commit 09576cf

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pytensor/configdefaults.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -1437,12 +1437,16 @@ def add_caching_dir_configvars():
14371437
add_numba_configvars()
14381438

14391439
# TODO: `gcc_version_str` is used by other modules.. Should it become an immutable config var?
1440-
try:
1441-
p_out = output_subprocess_Popen([config.cxx, "-dumpversion"])
1442-
gcc_version_str = p_out[0].strip().decode()
1443-
except OSError:
1444-
# Typically means gcc cannot be found.
1440+
if config.cxx != "":
1441+
try:
1442+
p_out = output_subprocess_Popen([config.cxx, "-dumpversion"])
1443+
gcc_version_str = p_out[0].strip().decode()
1444+
except OSError:
1445+
# Typically means gcc cannot be found.
1446+
gcc_version_str = "GCC_NOT_FOUND"
1447+
else:
14451448
gcc_version_str = "GCC_NOT_FOUND"
1449+
14461450
# TODO: The caching dir resolution is a procedural mess of helper functions, local variables
14471451
# and config definitions. And the result is also not particularly pretty..
14481452
add_caching_dir_configvars()

0 commit comments

Comments
 (0)