From d08d1771f1b60ff3b90eabf899bb9db67dc4da38 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Sun, 29 Sep 2019 21:11:26 +0200 Subject: [PATCH] Don't create our own `Compat.Sockets` (from #545, #594) Note that this still leaves `import Socket` so `using Compat.Sockets` will still work, although this should be deprecated in the future. --- README.md | 3 --- src/Compat.jl | 18 ++---------------- test/old.jl | 15 +++++++++++++++ test/runtests.jl | 16 ++-------------- 4 files changed, 19 insertions(+), 33 deletions(-) create mode 100644 test/old.jl diff --git a/README.md b/README.md index 90fcabec2..57e5b40ca 100644 --- a/README.md +++ b/README.md @@ -106,9 +106,6 @@ Currently, the `@compat` macro supports the following syntaxes: * `using Compat.Markdown` is provided on versions older than 0.7, where this library is not yet part of the standard library ([#25738]). -* `using Compat.Sockets` is provided on versions older than 0.7, where this library is - not yet part of the standard library ([#25935]) - * `using Compat.Statistics` is provided on versions older than 0.7, where this library is not yet part of the standard library ([#27834]). diff --git a/src/Compat.jl b/src/Compat.jl index 8fa251337..4f731d06b 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -2,22 +2,8 @@ VERSION < v"0.7.0-beta2.199" && __precompile__() module Compat -# https://github.com/JuliaLang/julia/pull/25935 -if VERSION < v"0.7.0-DEV.4442" - @eval module Sockets - import Base: - @ip_str, IPAddr, IPv4, IPv6, UDPSocket, TCPSocket, DNSError, - accept, connect, getaddrinfo, getipaddr, getsockname, listen, - listenany, recv, recvfrom, send, bind - - export - @ip_str, IPAddr, IPv4, IPv6, UDPSocket, TCPSocket, - accept, connect, getaddrinfo, getipaddr, getsockname, listen, - listenany, recv, recvfrom, send, bind - end -else - import Sockets -end +# to be deprecated +import Sockets include("compatmacro.jl") diff --git a/test/old.jl b/test/old.jl new file mode 100644 index 000000000..648991db0 --- /dev/null +++ b/test/old.jl @@ -0,0 +1,15 @@ +# tests of functionality to be deprecated + +# 0.7.0-DEV.3666 +module TestSockets + using Compat + using Compat.Sockets + using Compat.Test + + @test isdefined(@__MODULE__, :UDPSocket) + @test isdefined(@__MODULE__, :connect) + @test isdefined(@__MODULE__, :listen) + @test isdefined(@__MODULE__, :recv) + + @test ip"127.0.0.1".host == UInt32(2130706433) +end diff --git a/test/runtests.jl b/test/runtests.jl index a4ab5412c..895ad97e5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -913,20 +913,6 @@ import Compat.Markdown @test stderr === STDERR end -# 0.7.0-DEV.3666 -module TestSockets - using Compat - using Compat.Sockets - using Compat.Test - - @test isdefined(@__MODULE__, :UDPSocket) - @test isdefined(@__MODULE__, :connect) - @test isdefined(@__MODULE__, :listen) - @test isdefined(@__MODULE__, :recv) - - @test ip"127.0.0.1".host == UInt32(2130706433) -end - # 0.7.0-DEV.3526 module TestNames export foo @@ -1517,4 +1503,6 @@ if VERSION >= v"0.7" end end +include("old.jl") + nothing