Skip to content

Commit b28afc1

Browse files
author
Christopher Doris
committed
use the new module names
1 parent 6251814 commit b28afc1

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

pysrc/juliacall/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ def convert(T, x):
2424
def interactive(enable=True):
2525
"Allow the Julia event loop to run in the background of the Python REPL."
2626
if enable:
27-
PythonCall._set_python_input_hook()
27+
PythonCall.Compat._set_python_input_hook()
2828
else:
29-
PythonCall._unset_python_input_hook()
29+
PythonCall.Compat._unset_python_input_hook()
3030

3131
class JuliaError(Exception):
3232
"An error arising in Julia code."

pysrc/juliacall/ipython.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def load_ipython_extension(ip):
9595
ip.events.register('post_execute', PythonCall._ipython._flush_stdio)
9696
# push displays
9797
PythonCall.seval("""begin
98-
pushdisplay(_compat.PythonDisplay())
99-
pushdisplay(_compat.IPythonDisplay())
98+
pushdisplay(Compat.PythonDisplay())
99+
pushdisplay(Compat.IPythonDisplay())
100100
nothing
101101
end""")

src/JlWrap/C.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Cjl
22

3-
using ..._CPython: _CPython as C
4-
using ..._Utils: _Utils as Utils
3+
using ...C: C
4+
using ...Utils: Utils
55
using Base: @kwdef
66
using UnsafePointers: UnsafePtr
77
using Serialization: serialize, deserialize

src/JlWrap/JlWrap.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module JlWrap
88
using ..PythonCall: PythonCall
99
using ..Core
1010
using ..Core: C, Utils, pynew, @autopy, incref, decref, setptr!, getptr, pyjuliacallmodule, pycopy!, errcheck, errset, PyNULL, pyistuple, pyisnull, pyJuliaError, pydel!, pyistype, pytypecheck, pythrow, pytuple_getitem, pyisslice, pystr_asstring, pyosmodule, pyisstr
11-
using .._pyconvert: pyconvert, @pyconvert, PYCONVERT_PRIORITY_WRAP, pyconvert_add_rule, pyconvert_tryconvert, pyconvertarg, pyconvert_result
11+
using ..Convert: pyconvert, @pyconvert, PYCONVERT_PRIORITY_WRAP, pyconvert_add_rule, pyconvert_tryconvert, pyconvertarg, pyconvert_result
1212

1313
using Pkg: Pkg
1414
using Base: @propagate_inbounds, allocatedinline
@@ -48,7 +48,7 @@ function __init__()
4848
init_callback()
4949
# add packages to juliacall
5050
jl = pyjuliacallmodule
51-
jl.Core = Core
51+
jl.Core = Base.Core
5252
jl.Base = Base
5353
jl.Main = Main
5454
jl.Pkg = Pkg

src/PyMacro/PyMacro.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ py_macro_assign(body, ans, ex) = push!(body, :($ans = $ex))
149149

150150
py_macro_del(body, var, tmp) = if tmp; push!(body, :($pydel!($var))); end
151151

152-
ismacroexpr(ex, name) = isexpr(ex, :macrocall) && (ex.args[1] === Symbol(name) || ex.args[1] === GlobalRef(Core, Symbol(name)))
152+
ismacroexpr(ex, name) = isexpr(ex, :macrocall) && (ex.args[1] === Symbol(name) || ex.args[1] === GlobalRef(Base.Core, Symbol(name)))
153153

154154
function py_macro_lower(st, body, ans, ex; flavour=:expr)
155155

src/PythonCall.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include("JlWrap/JlWrap.jl")
1414
include("Compat/Compat.jl")
1515

1616
# re-export everything
17-
for m in [:_Py, :_pyconvert, :_pymacro, :_pywrap, :_jlwrap, :_compat]
17+
for m in [:Core, :Convert, :PyMacro, :Wrap, :JlWrap, :Compat]
1818
for k in names(@eval($m))
1919
if k != m
2020
@eval using .$m: $k
@@ -24,19 +24,19 @@ for m in [:_Py, :_pyconvert, :_pymacro, :_pywrap, :_jlwrap, :_compat]
2424
end
2525

2626
# non-exported API
27-
for k in [:C, :GC, :pynew, :pyisnull, :pycopy!, :getptr, :pydel!, :unsafe_pynext, :PyNULL, :CONFIG]
28-
@eval const $k = _Py.$k
27+
for k in [:pynew, :pyisnull, :pycopy!, :getptr, :pydel!, :unsafe_pynext, :PyNULL, :CONFIG]
28+
@eval const $k = Core.$k
2929
end
3030
for k in [:pyconvert_add_rule, :pyconvert_return, :pyconvert_unconverted, :PYCONVERT_PRIORITY_WRAP, :PYCONVERT_PRIORITY_ARRAY, :PYCONVERT_PRIORITY_CANONICAL, :PYCONVERT_PRIORITY_NORMAL, :PYCONVERT_PRIORITY_FALLBACK]
31-
@eval const $k = _pyconvert.$k
31+
@eval const $k = Convert.$k
3232
end
3333
for k in [:event_loop_on, :event_loop_off, :fix_qt_plugin_path]
34-
@eval const $k = _compat.$k
34+
@eval const $k = Compat.$k
3535
end
3636

3737
# not API but used in tests
3838
for k in [:pyjlanytype, :pyjlarraytype, :pyjlvectortype, :pyjlbinaryiotype, :pyjltextiotype, :pyjldicttype, :pyjlmoduletype, :pyjlintegertype, :pyjlrationaltype, :pyjlrealtype, :pyjlcomplextype, :pyjlsettype, :pyjltypetype]
39-
@eval const $k = _jlwrap.$k
39+
@eval const $k = JlWrap.$k
4040
end
4141

4242
end

test/Compat.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ end
2121
pystdout = sys.stdout
2222
fp = sys.stdout = io.StringIO()
2323
try
24-
d = PythonCall._compat.PythonDisplay()
24+
d = PythonCall.Compat.PythonDisplay()
2525
@test display(d, 123) === nothing
2626
fp.seek(0)
2727
@test pyconvert(String, fp.read()) == "123\n"

test/Utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@testitem "mimes_for" begin
22
for x in Any[1, "foo", [], 'z']
3-
@test PythonCall._Utils.mimes_for(x) isa Vector{String}
3+
@test PythonCall.Utils.mimes_for(x) isa Vector{String}
44
end
55
end
66

77
@testitem "StaticString length and indexing" begin
8-
s = PythonCall._Utils.StaticString{UInt32, 44}("ababababb")
8+
s = PythonCall.Utils.StaticString{UInt32, 44}("ababababb")
99
@test length(s) == 9
1010
@test s[1] == 'a'
1111
@test s[1:2] == "ab"

0 commit comments

Comments
 (0)