Skip to content

Commit 0a61076

Browse files
committed
Convert "\n" in script_jl to ";" in all OSes; "\r\n" didn't work
1 parent 7c395e3 commit 0a61076

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

julia/python_jl.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
script_jl = """
3030
import PyCall
3131
32-
# Initialize julia.Julia once so that subsequent calls of julia.Julia()
33-
# uses pre-configured DLL.
3432
PyCall.pyimport("julia")[:Julia](init_julia=false)
3533
3634
let code = PyCall.pyimport("julia.pseudo_python_cli")[:main](ARGS)
@@ -39,8 +37,10 @@
3937
end
4038
end
4139
"""
42-
if os.linesep != "\n": # in Windows
43-
script_jl = script_jl.replace("\n", os.linesep)
40+
# Julia(init_julia=false) is called above so that subsequent calls of
41+
# julia.Julia() uses pre-configured DLL.
42+
43+
oneliner_jl = script_jl.replace("\n", ";")
4444

4545

4646
def remove_julia_options(args):
@@ -114,7 +114,7 @@ def main(args=None):
114114
args = sys.argv[1:]
115115
ns, unused_args = parse_pyjl_args(args)
116116
julia = ns.julia
117-
os.execvp(julia, [julia, "-e", script_jl, "--"] + unused_args)
117+
os.execvp(julia, [julia, "-e", oneliner_jl, "--"] + unused_args)
118118

119119

120120
if __name__ == "__main__":

0 commit comments

Comments
 (0)