Skip to content

Commit

Permalink
Use require(pkgid, ...) instead of relative require
Browse files Browse the repository at this point in the history
Co-authored-by: Jameson Nash <[email protected]>
  • Loading branch information
vchuravy and vtjnash committed Oct 22, 2018
1 parent c162219 commit 8fa6a48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 5 additions & 1 deletion base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ function exec_options(opts)
# Load Distributed module only if any of the Distributed options have been specified.
distributed_mode = (opts.worker == 1) || (opts.nprocs > 0) || (opts.machine_file != C_NULL)
if distributed_mode
Core.eval(Main, :(using Distributed))
let Distributed = require(PkgId(UUID(0x8ba89e20_285c_5b6f_9357_94700520ee1b), "Distributed"))
Core.eval(Main, :(const Distributed = $Distributed))
Core.eval(Main, :(using .Distributed))
end

invokelatest(Main.Distributed.process_opts, opts)
end

Expand Down
8 changes: 2 additions & 6 deletions base/stream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ unlock(s::LibuvStream) = unlock(s.lock)
rawhandle(stream::LibuvStream) = stream.handle
unsafe_convert(::Type{Ptr{Cvoid}}, s::Union{LibuvStream, LibuvServer}) = s.handle

const Sockets_mod = Ref{Module}()

function init_stdio(handle::Ptr{Cvoid})
t = ccall(:jl_uv_handle_type, Int32, (Ptr{Cvoid},), handle)
if t == UV_FILE
Expand All @@ -233,10 +231,8 @@ function init_stdio(handle::Ptr{Cvoid})
elseif t == UV_TTY
return TTY(handle, StatusOpen)
elseif t == UV_TCP
if !isassigned(Sockets_mod)
Sockets_mod[] = Base.require(Base, :Sockets)
end
return Sockets_mod[].TCPSocket(handle, StatusOpen)
Sockets = require(PkgId(UUID(0x6462fe0b_24de_5631_8697_dd941f90decc), "Sockets"))
return Sockets.TCPSocket(handle, StatusOpen)
elseif t == UV_NAMED_PIPE
return PipeEndpoint(handle, StatusOpen)
else
Expand Down

0 comments on commit 8fa6a48

Please sign in to comment.