Skip to content

Commit c8f5f64

Browse files
author
Dani Pinyol
committed
Fix failure setting optimize option (#480)
1 parent b95e524 commit c8f5f64

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/julia/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class JuliaOptions(object):
134134
compile = Choices("compile", yes_no_etc("all", "min"))
135135
depwarn = Choices("depwarn", yes_no_etc("error"))
136136
warn_overwrite = Choices("warn_overwrite", yes_no_etc())
137-
optimize = Choices("optimize", dict(zip(range(4), range(4))))
137+
optimize = Choices("optimize", dict(zip(range(4), map(str, range(4)))))
138138
inline = Choices("inline", yes_no_etc())
139139
check_bounds = Choices("check_bounds", yes_no_etc())
140140

src/julia/tests/test_juliaoptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
(dict(compiled_modules="no"), ["--compiled-modules", "no"]),
1212
(dict(depwarn="error"), ["--depwarn", "error"]),
1313
(dict(sysimage="PATH"), ["--sysimage", "PATH"]),
14-
(dict(bindir="PATH"), ["--home", "PATH"]),
14+
(dict(optimize=3), ["--optimize", "3"]),
1515
])
1616
# fmt: on
1717
def test_as_args(kwargs, args):

src/julia/tests/test_options.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from julia.options import JuliaOptions, options_docs
1+
from julia.options import JuliaOptions, options_docs, parse_jl_options
22

33

44
def parse_options_docs(docs):
@@ -23,3 +23,9 @@ def test_options_docs():
2323
odef = optdefs.pop(desc.name)
2424
assert odef["domain"] == desc._domain()
2525
assert not optdefs
26+
27+
28+
def test_parse_jl_options():
29+
opts = parse_jl_options(["--home", "/home", "--sysimage", "/sys/image", "--optimize", "3"])
30+
assert opts.home == "/home"
31+
assert opts.sysimage == "/sys/image"

0 commit comments

Comments
 (0)