Skip to content

Commit 799dc2d

Browse files
REPLExt: use Base.isaccessibledir rather than isdir in completions (#4053)
1 parent 3fde94e commit 799dc2d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

ext/REPLExt/completions.jl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function _shared_envs()
55
possible = String[]
66
for depot in Base.DEPOT_PATH
77
envdir = joinpath(depot, "environments")
8-
isdir(envdir) || continue
8+
Base.isaccessibledir(envdir) || continue
99
append!(possible, readdir(envdir))
1010
end
1111
return possible
@@ -38,15 +38,7 @@ function complete_expanded_local_dir(s, i1, i2, expanded_user, oldi2)
3838
cmp2 = cmp[2]
3939
completions = [REPL.REPLCompletions.completion_text(p) for p in cmp[1]]
4040
completions = filter!(completions) do x
41-
try
42-
isdir(s[1:prevind(s, first(cmp2)-i1+1)]*x)
43-
catch e
44-
if e isa Base.IOError && e.code == Base.UV_EACCES
45-
return false
46-
else
47-
rethrow()
48-
end
49-
end
41+
Base.isaccessibledir(s[1:prevind(s, first(cmp2)-i1+1)]*x)
5042
end
5143
if expanded_user
5244
if length(completions) == 1 && endswith(joinpath(homedir(), ""), first(completions))

0 commit comments

Comments
 (0)