Skip to content

Commit

Permalink
DEBUG: Print on error
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Oct 24, 2021
1 parent 7ae9698 commit 65015bc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/julia/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from .libjulia import UNBOXABLE_TYPES, LibJulia, get_inprocess_libjulia, get_libjulia
from .options import JuliaOptions, options_docs
from .release import __version__
from .utils import IMPORT_PYCALL, is_windows
from .utils import IMPORT_PYCALL, PYCALL_PKGID, is_windows

try:
from shutil import which
Expand Down Expand Up @@ -500,7 +500,15 @@ def __init__(self, init_julia=True, jl_init_path=None, runtime=None,

# Currently, PyJulia assumes that `Main.PyCall` exsits. Thus, we need
# to import `PyCall` again here in case `init_julia=False` is passed:
self._call(IMPORT_PYCALL)
self._call(f"""
const PyCall = try
Base.require({PYCALL_PKGID})
catch err
@error "Failed to import PyCall" exception = (err, catch_backtrace())
rethrow()
end
""")

self._call(u"using .PyCall")

# Whether we initialized Julia or not, we MUST create at least one
Expand Down

0 comments on commit 65015bc

Please sign in to comment.