From 56a739126d3fed0d24e548069ff216fea78fbe1b Mon Sep 17 00:00:00 2001 From: Jasha10 <8935917+Jasha10@users.noreply.github.com> Date: Fri, 7 Jan 2022 21:32:24 -0600 Subject: [PATCH] fix `sysimage` argument to `julia.core.Julia.__init__` (#482) 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 --- src/julia/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/julia/core.py b/src/julia/core.py index 9d54d108..183298c4 100644 --- a/src/julia/core.py +++ b/src/julia/core.py @@ -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)