Skip to content

Commit

Permalink
revert error msg in SystemError
Browse files Browse the repository at this point in the history
  • Loading branch information
fatteneder committed Jun 7, 2024
1 parent 3d92e56 commit e0ff13c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2059,9 +2059,9 @@ function _include_dependency(mod::Module, _path::AbstractString; track_content=t
end
if !_track_dependencies[]
if !path_may_be_dir && !isfile(path)
throw(SystemError("including file $(repr(path))", Libc.ENOENT))
throw(SystemError("opening file $(repr(path))", Libc.ENOENT))
elseif path_may_be_dir && !Filesystem.isreadable(path)
throw(SystemError("including file or folder $(repr(path))", Libc.ENOENT))
throw(SystemError("opening file or folder $(repr(path))", Libc.ENOENT))
end
else
@lock require_lock begin
Expand Down
6 changes: 3 additions & 3 deletions test/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ end
exc = try; include("./notarealfile.jl"); "unexpectedly reached!"; catch exc; exc; end
@test exc isa SystemError
exc.prefix
end == "including file $(repr(joinpath(@__DIR__, "notarealfile.jl")))"
end == "opening file $(repr(joinpath(@__DIR__, "notarealfile.jl")))"

old_act_proj = Base.ACTIVE_PROJECT[]
pushfirst!(LOAD_PATH, "@")
Expand Down Expand Up @@ -1549,7 +1549,7 @@ end
end

file = joinpath(depot, "dev", "non-existent.jl")
@test_throws SystemError("including file $(repr(file))") include(file)
@test_throws SystemError("opening file $(repr(file))") include(file)
touch(file)
@test include_dependency(file) === nothing
chmod(file, 0x000)
Expand All @@ -1559,7 +1559,7 @@ end
@test include_dependency(dir) === nothing
dir
end
@test_throws SystemError("including file or folder $(repr(dir))") include_dependency(dir)
@test_throws SystemError("opening file or folder $(repr(dir))") include_dependency(dir)
end
end

Expand Down

0 comments on commit e0ff13c

Please sign in to comment.