Skip to content

Commit 7bc2387

Browse files
committed
refactor: avoid spooky action at a distance in init
1 parent ce54b86 commit 7bc2387

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pysrc/juliacall/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ def int_option(name, *, accept_auto=False, **kw):
109109
except ValueError:
110110
raise ValueError(f'{s}: expecting an int'+(' or auto' if accept_auto else ""))
111111

112-
def args_from_config():
113-
argv = [CONFIG['exepath']]
114-
for opt, val in CONFIG.items():
112+
def args_from_config(config):
113+
argv = [config['exepath']]
114+
for opt, val in config.items():
115115
if opt.startswith('opt_'):
116116
if val is None:
117117
if opt == 'opt_handle_signals':
@@ -181,7 +181,7 @@ def args_from_config():
181181
CONFIG['lib'] = lib = c.PyDLL(libpath, mode=c.RTLD_GLOBAL)
182182

183183
# parse options
184-
argc, argv = args_from_config()
184+
argc, argv = args_from_config(CONFIG)
185185
jl_parse_opts = lib.jl_parse_opts
186186
jl_parse_opts.argtypes = [c.c_void_p, c.c_void_p]
187187
jl_parse_opts.restype = None

0 commit comments

Comments
 (0)