Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use __DIR__ instead of dirname at __FILE__ in misc files #30054

Merged
merged 1 commit into from
Nov 16, 2018

Conversation

musm
Copy link
Contributor

@musm musm commented Nov 16, 2018

Very minor simplification

@StefanKarpinski
Copy link
Sponsor Member

StefanKarpinski commented Nov 16, 2018

Thanks! This usage probably dates from before we introduced @__DIR__. Grepping reveals a handful of other usages of dirname(@__FILE__):

contrib/add_license_to_files.jl:    abs_p = isabspath(p) ? normpath(p) : normpath(joinpath(dirname(@__FILE__), p))
stdlib/Libdl/test/runtests.jl:    cd(dirname(@__FILE__)) do
stdlib/Libdl/test/runtests.jl:    push!(Libdl.DL_LOAD_PATH, dirname(@__FILE__))
stdlib/Libdl/test/runtests.jl:    push!(Libdl.DL_LOAD_PATH, dirname(@__FILE__))
test/loading.jl:    @test @__DIR__() == dirname(@__FILE__)
test/runtests.jl:    cd(dirname(@__FILE__)) do

Care to replace all of them while you're at it?

@musm
Copy link
Contributor Author

musm commented Nov 16, 2018

@StefanKarpinski I'll be glad to, I'll update the PR accordingly

@musm musm changed the title Use __DIR__ instead of dirname at __FILE__ in runtests Use __DIR__ instead of dirname at __FILE__ in misc files Nov 16, 2018
@ararslan ararslan merged commit 13e9839 into JuliaLang:master Nov 16, 2018
@musm musm deleted the patch-10 branch November 16, 2018 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants