Skip to content

Commit

Permalink
fix sysimage argument to julia.core.Julia.__init__ (#482)
Browse files Browse the repository at this point in the history
On `master` branch, it should be possible to pass a custom "sysimage" to
the `julia.core.Julia.__init__` method. However, if the python version
in use is statically linked, an UnsupportedPythonError is thrown
(despite the sysimage argument having been passed to `__init__`).

This commit prevents the UnsupportedPythonError from being thrown if a
sysimage keyword argument is passed to `__init__`.
Closes #421
  • Loading branch information
Jasha10 authored Jan 8, 2022
1 parent cec4bf0 commit 56a7391
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/julia/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,14 @@ def __init__(self, init_julia=True, jl_init_path=None, runtime=None,

is_compatible_python = jlinfo.is_compatible_python()
logger.debug("is_compatible_python = %r", is_compatible_python)
use_custom_sysimage = options.sysimage is not None
logger.debug("use_custom_sysimage = %r", use_custom_sysimage)
logger.debug("compiled_modules = %r", options.compiled_modules)
if not (options.compiled_modules == "no" or is_compatible_python):
if not (
options.compiled_modules == "no"
or is_compatible_python
or use_custom_sysimage
):
raise UnsupportedPythonError(jlinfo)

self.api.init_julia(options)
Expand Down

1 comment on commit 56a7391

@MilesCranmer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tkf could this be released as a new version?

Please sign in to comment.