madMAx executable discovery error handling cleanup (#9501)

* Add missing version=None for

* Log errors in get_madmax_install_info() instead of printing
This commit is contained in:
Kyle Altendorf 2022-02-15 01:28:42 -05:00 committed by GitHub
parent ff88892e73
commit 65c0829f66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,7 @@ def get_madmax_install_info(plotters_root_path: Path) -> Optional[Dict[str, Any]
supported: bool = is_madmax_supported()
if get_madmax_executable_path_for_ksize(plotters_root_path).exists():
version = None
try:
proc = run_command(
[os.fspath(get_madmax_executable_path_for_ksize(plotters_root_path)), "--version"],
@ -54,7 +55,8 @@ def get_madmax_install_info(plotters_root_path: Path) -> Optional[Dict[str, Any]
)
version = proc.stdout.strip()
except Exception as e:
print(f"Failed to determine madmax version: {e}")
tb = traceback.format_exc()
log.error(f"Failed to determine madmax version: {e} {tb}")
if version is not None:
installed = True