macOS audio tools no longer reside in audio/ subfolder

+ fix error message broken by automated .tr() syntax change
This commit is contained in:
Damien Elmes 2021-12-09 17:33:46 +10:00
parent 1b72cd65ea
commit db804d9544

View file

@ -236,7 +236,10 @@ def _packagedCmd(cmd: list[str]) -> tuple[Any, dict[str, str]]:
if "LD_LIBRARY_PATH" in env:
del env["LD_LIBRARY_PATH"]
packaged_path = Path(sys.prefix) / "audio" / (cmd[0] + (".exe" if is_win else ""))
if is_win:
packaged_path = Path(sys.prefix) / "audio" / (cmd[0] + ".exe")
else:
packaged_path = Path(sys.prefix) / cmd[0]
if packaged_path.exists():
cmd[0] = str(packaged_path)
@ -485,9 +488,9 @@ def _encode_mp3(src_wav: str, dst_mp3: str) -> None:
try:
retcode = retryWait(subprocess.Popen(cmd, startupinfo=startup_info(), env=env))
except Exception as e:
raise Exception(tr.media_error_running(val=" ").join(cmd)) from e
raise Exception(tr.media_error_running(val=" ".join(cmd))) from e
if retcode != 0:
raise Exception(tr.media_error_running(val=" ").join(cmd))
raise Exception(tr.media_error_running(val=" ".join(cmd)))
os.unlink(src_wav)