Skip to content

Commit

Permalink
Throw exception when julia --version fails. (#49)
Browse files Browse the repository at this point in the history
* Throw exception when `julia --version` fails.

* Fix formatting

* make error message consistent

---------

Co-authored-by: Christopher Doris <github.com/cjdoris>
  • Loading branch information
lte678 authored Feb 21, 2025
1 parent 714816a commit 889f2f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/juliapkg/find_julia.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,9 @@ def ju_find_julia_noinstall(compat=None):
versions.sort(key=lambda x: x[1], reverse=True)
for exe, _ in versions:
ver = julia_version(exe)
if ver is None:
raise Exception(
f"{exe} (installed by juliaup) is not a valid Julia executable"
)
if compat is None or ver in compat:
return (exe, ver)

0 comments on commit 889f2f0

Please sign in to comment.