Skip to content

Commit 283bba1

Browse files
authored
drop more 0.6 code (JuliaLang#728)
1 parent 34190dd commit 283bba1

File tree

11 files changed

+23
-38
lines changed

11 files changed

+23
-38
lines changed

deps/build.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ kspec_cmd, = installkernel("Julia")
9292
# "kernelspec" with "notebook":
9393
notebook = kspec_cmd.exec
9494
n = notebook[end]
95-
ki = VERSION < v"0.7.0-DEV.3252" ? rsearch(n, "kernelspec") : findlast("kernelspec", n)
95+
ki = findlast("kernelspec", n)
9696
notebook[end] = n[1:prevind(n,first(ki))] * "notebook" * n[nextind(n,last(ki)):end]
9797

9898
#######################################################################

deps/kspec.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#######################################################################
22
# Install Jupyter kernel-spec file.
33

4-
copy_config(src, dest) = Compat.cp(src, joinpath(dest, basename(src)), force=true)
4+
copy_config(src, dest) = cp(src, joinpath(dest, basename(src)), force=true)
55

66
"""
77
installkernel(name, options...; specname=replace(lowercase(name), " "=>"-")
@@ -40,8 +40,8 @@ function installkernel(name::AbstractString, julia_options::AbstractString...;
4040

4141
juliakspec = joinpath(tempdir(), spec_name)
4242
try
43-
binary_name = Compat.Sys.iswindows() ? "julia.exe" : "julia"
44-
kernelcmd_array = String[joinpath(Compat.Sys.BINDIR,"$binary_name"), "-i",
43+
binary_name = Sys.iswindows() ? "julia.exe" : "julia"
44+
kernelcmd_array = String[joinpath(Sys.BINDIR,"$binary_name"), "-i",
4545
"--startup-file=yes", "--color=yes"]
4646
append!(kernelcmd_array, julia_options)
4747
ijulia_dir = get(ENV, "IJULIA_DIR", dirname(@__DIR__)) # support non-Pkg IJulia installs
@@ -65,7 +65,7 @@ function installkernel(name::AbstractString, julia_options::AbstractString...;
6565
copy_config(joinpath(ijulia_dir,"deps","logo-32x32.png"), juliakspec)
6666
copy_config(joinpath(ijulia_dir,"deps","logo-64x64.png"), juliakspec)
6767

68-
Compat.@info("Installing $name kernelspec $spec_name")
68+
@info("Installing $name kernelspec $spec_name")
6969

7070
# remove these hacks when
7171
# https://github.com/jupyter/notebook/issues/448 is closed and the fix
@@ -75,13 +75,13 @@ function installkernel(name::AbstractString, julia_options::AbstractString...;
7575
run(`$jupyter kernelspec install --replace --user $juliakspec`)
7676
push!(kspec_cmd, jupyter, "kernelspec")
7777
catch
78-
@static if Compat.Sys.isunix()
78+
@static if Sys.isunix()
7979
run(`$jupyter-kernelspec install --replace --user $juliakspec`)
8080
push!(kspec_cmd, jupyter * "-kernelspec")
8181
end
8282

8383
# issue #363:
84-
@static if Compat.Sys.iswindows()
84+
@static if Sys.iswindows()
8585
jupyter_dir = dirname(jupyter)
8686
jks_exe = ""
8787
if jupyter_dir == abspath(Conda.SCRIPTDIR)

src/IJulia.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
VERSION < v"0.7.0-beta2.199" && __precompile__()
2-
31
"""
42
**IJulia** is a [Julia-language](http://julialang.org/) backend
53
combined with the [Jupyter](http://jupyter.org/) interactive
@@ -113,7 +111,7 @@ process manager.)
113111
"""
114112
function notebook(; dir=homedir(), detached=false)
115113
inited && error("IJulia is already running")
116-
if Compat.Sys.isapple() # issue #551 workaround, remove after macOS 10.12.6 release?
114+
if Sys.isapple() # issue #551 workaround, remove after macOS 10.12.6 release?
117115
withenv("BROWSER"=>"open") do
118116
p = run(Cmd(`$notebook_cmd`, detach=true, dir=dir); wait=false)
119117
end
@@ -276,7 +274,7 @@ Remove a function `f()` from the list of functions to
276274
execute after executing any notebook cell.
277275
"""
278276
pop_postexecute_hook(f::Function) =
279-
splice!(postexecute_hooks, Compat.findlast(isequal(f), postexecute_hooks))
277+
splice!(postexecute_hooks, findlast(isequal(f), postexecute_hooks))
280278

281279
const preexecute_hooks = Function[]
282280
"""
@@ -293,7 +291,7 @@ Remove a function `f()` from the list of functions to
293291
execute before executing any notebook cell.
294292
"""
295293
pop_preexecute_hook(f::Function) =
296-
splice!(preexecute_hooks, Compat.findlast(isequal(f), preexecute_hooks))
294+
splice!(preexecute_hooks, findlast(isequal(f), preexecute_hooks))
297295

298296
# similar, but called after an error (e.g. to reset plotting state)
299297
const posterror_hooks = Function[]
@@ -311,7 +309,7 @@ Remove a function `f()` from the list of functions to
311309
execute after an error occurs when a notebook cell is evaluated.
312310
"""
313311
pop_posterror_hook(f::Function) =
314-
splice!(posterror_hooks, Compat.findlast(isequal(f), posterror_hooks))
312+
splice!(posterror_hooks, findlast(isequal(f), posterror_hooks))
315313

316314
#######################################################################
317315

src/handlers.jl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,8 @@ function complete_request(socket, msg)
125125
end
126126

127127
codestart = find_parsestart(code, cursorpos)
128-
@static if VERSION >= v"0.7.0-beta.207"
129-
comps_, positions = REPLCompletions.completions(code[codestart:end], cursorpos-codestart+1, current_module[])
130-
else
131-
comps_, positions = REPLCompletions.completions(code[codestart:end], cursorpos-codestart+1)
132-
end
133-
@static if isdefined(REPLCompletions, :completion_text)
134-
comps = unique!(REPLCompletions.completion_text.(comps_)) # julia#26930
135-
else
136-
comps = comps_
137-
end
128+
comps_, positions = REPLCompletions.completions(code[codestart:end], cursorpos-codestart+1, current_module[])
129+
comps = unique!(REPLCompletions.completion_text.(comps_)) # julia#26930
138130
# positions = positions .+ (codestart - 1) on Julia 0.7
139131
positions = (first(positions) + codestart - 1):(last(positions) + codestart - 1)
140132
metadata = Dict()

src/inline.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Base: display, redisplay
22

3-
struct InlineDisplay <: Compat.AbstractDisplay end
3+
struct InlineDisplay <: AbstractDisplay end
44

55
# supported MIME types for inline display in IPython, in descending order
66
# of preference (descending "richness")

src/kernel.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import IJulia
22
using InteractiveUtils
33

44
# workaround #60:
5-
if IJulia.Compat.Sys.isapple()
6-
ENV["PATH"] = IJulia.Compat.Sys.BINDIR*":"*ENV["PATH"]
5+
if Sys.isapple()
6+
ENV["PATH"] = Sys.BINDIR*":"*ENV["PATH"]
77
end
88

99
IJulia.init(ARGS)
@@ -13,7 +13,7 @@ import IJulia: ans, In, Out, clear_history
1313

1414
pushdisplay(IJulia.InlineDisplay())
1515

16-
ccall(:jl_exit_on_sigint, IJulia.Compat.Cvoid, (Cint,), 0)
16+
ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 0)
1717

1818
# the size of truncated output to show should not depend on the terminal
1919
# where the kernel is launched, since the display is elsewhere

src/magics.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ function magics_help(code::AbstractString)
2323
end
2424
end
2525

26-
@static if VERSION < v"0.7.0-DEV.3589" # julia#25738
27-
using Base.Markdown
28-
else
29-
using Markdown
30-
end
26+
using Markdown
3127

3228
const magic_help_string = """
3329
Julia does not use the IPython `%magic` syntax. To interact

test/comm.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Compat.Test
1+
using Test
22
import IJulia: Comm, comm_target
33

44

test/execute_request.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Compat.Test
1+
using Test
22

33
import IJulia: helpmode, error_content, docdict
44

test/msg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using Compat.Test
1+
using Test
22
import IJulia: Msg
3-
using Compat.Dates
3+
using Dates
44

55
idents = ["idents"]
66
header = Dict("msg_id"=>"c673eed8-7c36-47f4-82af-df8ec546a87d",

0 commit comments

Comments
 (0)