Skip to content

Commit 2a638c6

Browse files
author
Kristoffer Carlsson
authored
use a non throwing version of isfile (#53)
1 parent 79e8349 commit 2a638c6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ function maybe_fix_path(file)
9696
return maybe_fixup_stdlib_path(file)
9797
end
9898

99+
safe_isfile(x) = try isfile(x); catch; false end
99100
const BUILDBOT_STDLIB_PATH = dirname(abspath(joinpath(String((@which uuid1()).file), "..", "..", "..")))
100101
replace_buildbot_stdlibpath(str::String) = replace(str, BUILDBOT_STDLIB_PATH => Sys.STDLIB)
101102
"""
@@ -109,9 +110,9 @@ are, for non source Julia builds, given as absolute paths on the worker that bui
109110
This function corrects such a path to instead refer to the local path on the users drive.
110111
"""
111112
function maybe_fixup_stdlib_path(path)
112-
if !isfile(path)
113+
if !safe_isfile(path)
113114
maybe_stdlib_path = replace_buildbot_stdlibpath(path)
114-
isfile(maybe_stdlib_path) && return maybe_stdlib_path
115+
safe_isfile(maybe_stdlib_path) && return maybe_stdlib_path
115116
end
116117
return path
117118
end

0 commit comments

Comments
 (0)