From 8b9384f7360b1fa4cbfe601176b064819b383f73 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Wed, 15 Apr 2020 14:40:38 +0200 Subject: [PATCH] use a non throwing version of isfile --- src/utils.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.jl b/src/utils.jl index 428f75d..a4a702e 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -96,6 +96,7 @@ function maybe_fix_path(file) return maybe_fixup_stdlib_path(file) end +safe_isfile(x) = try isfile(x); catch; false end const BUILDBOT_STDLIB_PATH = dirname(abspath(joinpath(String((@which uuid1()).file), "..", "..", ".."))) replace_buildbot_stdlibpath(str::String) = replace(str, BUILDBOT_STDLIB_PATH => Sys.STDLIB) """ @@ -109,9 +110,9 @@ are, for non source Julia builds, given as absolute paths on the worker that bui This function corrects such a path to instead refer to the local path on the users drive. """ function maybe_fixup_stdlib_path(path) - if !isfile(path) + if !safe_isfile(path) maybe_stdlib_path = replace_buildbot_stdlibpath(path) - isfile(maybe_stdlib_path) && return maybe_stdlib_path + safe_isfile(maybe_stdlib_path) && return maybe_stdlib_path end return path end