From 98aa5897de6e4831fb053b15a4649e116531668a Mon Sep 17 00:00:00 2001 From: Christopher Doris Date: Tue, 19 Mar 2024 18:31:35 +0000 Subject: [PATCH] remove lingering references to _Py --- src/Compat/Compat.jl | 2 +- src/Compat/gui.jl | 2 +- src/Compat/pycall.jl | 2 +- src/JlWrap/JlWrap.jl | 1 + src/JlWrap/objectarray.jl | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Compat/Compat.jl b/src/Compat/Compat.jl index dcb1398d..ede2bcf8 100644 --- a/src/Compat/Compat.jl +++ b/src/Compat/Compat.jl @@ -6,7 +6,7 @@ Misc bits and bobs for compatibility. module Compat using ..PythonCall: PythonCall # needed for docstring cross-refs using ..Core - using ..Core: C, Utils, pynew, incref, getptr, pycopy!, pymodulehooks, pyisnull, pybytes_asvector, pysysmodule, pyosmodule, pystr_fromUTF8 + using ..Core: Core, C, Utils, pynew, incref, getptr, pycopy!, pymodulehooks, pyisnull, pybytes_asvector, pysysmodule, pyosmodule, pystr_fromUTF8 using ..Convert: pyconvert, @pyconvert using ..Wrap: PyArray, PyPandasDataFrame using Serialization: Serialization, AbstractSerializer, serialize, deserialize diff --git a/src/Compat/gui.jl b/src/Compat/gui.jl index 6f6f8a01..8132fe87 100644 --- a/src/Compat/gui.jl +++ b/src/Compat/gui.jl @@ -130,7 +130,7 @@ function init_gui() pycopy!(new_event_loop_callback, g["new_event_loop_callback"]) # add a hook to automatically call fix_qt_plugin_path() - fixqthook = Py(() -> (_Py.CONFIG.auto_fix_qt_plugin_path && fix_qt_plugin_path(); nothing)) + fixqthook = Py(() -> (Core.CONFIG.auto_fix_qt_plugin_path && fix_qt_plugin_path(); nothing)) pymodulehooks.add_hook("PyQt4", fixqthook) pymodulehooks.add_hook("PyQt5", fixqthook) pymodulehooks.add_hook("PySide", fixqthook) diff --git a/src/Compat/pycall.jl b/src/Compat/pycall.jl index 0bf9cec7..8c06f5d3 100644 --- a/src/Compat/pycall.jl +++ b/src/Compat/pycall.jl @@ -10,7 +10,7 @@ function init_pycall(PyCall::Module) - Set the environment variable `PYTHON` to `PythonCall.C.CTX.exe_path` and rebuild PyCall. This forces PyCall to use the same interpreter as PythonCall, but needs to be repeated whenever you switch Julia environment. """ - @eval function _Py.Py(x::$PyCall.PyObject) + @eval function Core.Py(x::$PyCall.PyObject) C.CTX.matches_pycall::Bool || error($errmsg) return pynew(C.PyPtr($PyCall.pyreturn(x))) end diff --git a/src/JlWrap/JlWrap.jl b/src/JlWrap/JlWrap.jl index b794f366..498cc382 100644 --- a/src/JlWrap/JlWrap.jl +++ b/src/JlWrap/JlWrap.jl @@ -9,6 +9,7 @@ using ..PythonCall: PythonCall using ..Core 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 using ..Convert: pyconvert, @pyconvert, PYCONVERT_PRIORITY_WRAP, pyconvert_add_rule, pyconvert_tryconvert, pyconvertarg, pyconvert_result +using ..GC: GC using Pkg: Pkg using Base: @propagate_inbounds, allocatedinline diff --git a/src/JlWrap/objectarray.jl b/src/JlWrap/objectarray.jl index 3aa0bb25..2aab4be2 100644 --- a/src/JlWrap/objectarray.jl +++ b/src/JlWrap/objectarray.jl @@ -23,7 +23,7 @@ PyObjectArray(undef::UndefInitializer, dims::Vararg{Integer,N}) where {N} = PyOb PyObjectArray{N}(x::AbstractArray{T,N}) where {T,N} = copyto!(PyObjectArray{N}(undef, size(x)), x) PyObjectArray(x::AbstractArray{T,N}) where {T,N} = PyObjectArray{N}(x) -pyobjectarray_finalizer(x::PyObjectArray) = _Py.GC.enqueue_all(x.ptrs) +pyobjectarray_finalizer(x::PyObjectArray) = GC.enqueue_all(x.ptrs) Base.IndexStyle(x::PyObjectArray) = Base.IndexStyle(x.ptrs)