Skip to content

Commit 15da449

Browse files
committed
revert error msg in SystemError
1 parent 3d92e56 commit 15da449

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

base/loading.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,9 +2059,9 @@ function _include_dependency(mod::Module, _path::AbstractString; track_content=t
20592059
end
20602060
if !_track_dependencies[]
20612061
if !path_may_be_dir && !isfile(path)
2062-
throw(SystemError("including file $(repr(path))", Libc.ENOENT))
2062+
throw(SystemError("opening file $(repr(path))", Libc.ENOENT))
20632063
elseif path_may_be_dir && !Filesystem.isreadable(path)
2064-
throw(SystemError("including file or folder $(repr(path))", Libc.ENOENT))
2064+
throw(SystemError("opening file or folder $(repr(path))", Libc.ENOENT))
20652065
end
20662066
else
20672067
@lock require_lock begin

test/loading.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ end
652652
exc = try; include("./notarealfile.jl"); "unexpectedly reached!"; catch exc; exc; end
653653
@test exc isa SystemError
654654
exc.prefix
655-
end == "including file $(repr(joinpath(@__DIR__, "notarealfile.jl")))"
655+
end == "opening file $(repr(joinpath(@__DIR__, "notarealfile.jl")))"
656656

657657
old_act_proj = Base.ACTIVE_PROJECT[]
658658
pushfirst!(LOAD_PATH, "@")
@@ -1549,7 +1549,7 @@ end
15491549
end
15501550

15511551
file = joinpath(depot, "dev", "non-existent.jl")
1552-
@test_throws SystemError("including file $(repr(file))") include(file)
1552+
@test_throws SystemError("opening file $(repr(file))") include(file)
15531553
touch(file)
15541554
@test include_dependency(file) === nothing
15551555
chmod(file, 0x000)
@@ -1559,7 +1559,7 @@ end
15591559
@test include_dependency(dir) === nothing
15601560
dir
15611561
end
1562-
@test_throws SystemError("including file or folder $(repr(dir))") include_dependency(dir)
1562+
@test_throws SystemError("opening file or folder $(repr(dir))") include_dependency(dir)
15631563
end
15641564
end
15651565

test/precompile.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,18 +1962,18 @@ end
19621962

19631963
precompile_test_harness("Issue #52063") do load_path
19641964
fname = joinpath(load_path, "i_do_not_exist.jl")
1965-
@test_throws ArgumentError("$(repr(fname)): No such file or directory") include_dependency(fname)
1965+
@test_throws SystemError("opening file or folder $(repr(fname))") include_dependency(fname)
19661966
touch(fname)
19671967
@test include_dependency(fname) === nothing
19681968
chmod(fname, 0x000)
1969-
@test_throws ArgumentError("$(repr(fname)): Missing read permission") include_dependency(fname)
1969+
@test_throws SystemError("opening file or folder $(repr(fname))", Libc.ENOENT) include_dependency(fname)
19701970
dir = mktempdir() do dir
19711971
@test include_dependency(dir) === nothing
19721972
chmod(dir, 0x000)
1973-
@test_throws ArgumentError("$(repr(dir)): Missing read permission") include_dependency(dir)
1973+
@test_throws SystemError("opening file or folder $(repr(dir))", Libc.ENOENT) include_dependency(dir)
19741974
dir
19751975
end
1976-
@test_throws ArgumentError("$(repr(dir)): No such file or directory") include_dependency(dir)
1976+
@test_throws SystemError("opening file or folder $(repr(dir))") include_dependency(dir)
19771977
end
19781978

19791979
finish_precompile_test!()

0 commit comments

Comments
 (0)