@@ -30,16 +30,19 @@ const read_stdout = Ref{Base.PipeEndpoint}()
3030const read_stderr = Ref {Base.PipeEndpoint} ()
3131const socket_locks = Dict {Socket,ReentrantLock} ()
3232
33- # similar to Pkg.REPLMode.MiniREPL, a minimal REPL-like emulator
34- # for use with Pkg.do_cmd. We have to roll our own to
35- # make sure it uses the redirected stdout, and because
36- # we don't have terminal support.
37- import REPL
38- struct MiniREPL <: REPL.AbstractREPL
39- display:: TextDisplay
33+ # needed for executing pkg commands on earlier Julia versions
34+ @static if VERSION < v " 1.11"
35+ # similar to Pkg.REPLMode.MiniREPL, a minimal REPL-like emulator
36+ # for use with Pkg.do_cmd. We have to roll our own to
37+ # make sure it uses the redirected stdout, and because
38+ # we don't have terminal support.
39+ import REPL
40+ struct MiniREPL <: REPL.AbstractREPL
41+ display:: TextDisplay
42+ end
43+ REPL. REPLDisplay (repl:: MiniREPL ) = repl. display
44+ const minirepl = Ref {MiniREPL} ()
4045end
41- REPL. REPLDisplay (repl:: MiniREPL ) = repl. display
42- const minirepl = Ref {MiniREPL} ()
4346
4447function init (args)
4548 inited && error (" IJulia is already running" )
@@ -108,7 +111,9 @@ function init(args)
108111 redirect_stderr (IJuliaStdio (stderr ," stderr" ))
109112 end
110113 redirect_stdin (IJuliaStdio (stdin ," stdin" ))
111- minirepl[] = MiniREPL (TextDisplay (stdout ))
114+ @static if VERSION < v " 1.11"
115+ minirepl[] = MiniREPL (TextDisplay (stdout ))
116+ end
112117
113118 logger = ConsoleLogger (Base. stderr )
114119 Base. CoreLogging. global_logger (logger)
0 commit comments