Skip to content

Commit 113bbc9

Browse files
committed
Support getproperty-based PyCall API
1 parent 39a76c1 commit 113bbc9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/core.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
using PyCall
22
import Conda
33

4+
const _getproperty = try
5+
pyimport("sys").executable
6+
getproperty
7+
catch
8+
getindex
9+
end
10+
411
julia_exepath() =
512
joinpath(VERSION < v"0.7.0-DEV.3073" ? JULIA_HOME : Base.Sys.BINDIR,
613
Base.julia_exename())
714

815
function _start_ipython(name; kwargs...)
9-
pyimport("ipython_jl")[name](;
16+
_getproperty(pyimport("ipython_jl"), name)(;
1017
eval_str = JuliaAPI.eval_str,
1118
api = JuliaAPI,
1219
kwargs...)
@@ -17,6 +24,6 @@ function start_ipython(; kwargs...)
1724
end
1825

1926
function __init__()
20-
pushfirst!(PyVector(pyimport("sys")["path"]), @__DIR__)
27+
pushfirst!(PyVector(_getproperty(pyimport("sys"), "path")), @__DIR__)
2128
afterreplinit(init_repl)
2229
end

0 commit comments

Comments
 (0)