File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -17,3 +17,22 @@ def test_issue_394():
17
17
assert jl .f is f
18
18
assert jl .y is y
19
19
assert jl .seval ("f(x)" ) == 4
20
+
21
+ def test_issue_433 ():
22
+ "https://github.com/JuliaPy/PythonCall.jl/issues/433"
23
+ from juliacall import Main as jl
24
+
25
+ # Smoke test
26
+ jl .seval ("x=1\n x=1" )
27
+ assert jl .x == 1
28
+
29
+ # Do multiple things
30
+ out = jl .seval (
31
+ """
32
+ function _issue_433_g(x)
33
+ return x^2
34
+ end
35
+ _issue_433_g(5)
36
+ """
37
+ )
38
+ assert out == 25
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ function pyjlmodule_dir(self::Module)
10
10
end
11
11
12
12
function pyjlmodule_seval (self:: Module , expr:: Py )
13
- Py (Base. eval (self, Meta. parse (strip (pyconvert (String, expr)))))
13
+ Py (Base. eval (self, Meta. parseall (strip (pyconvert (String, expr)))))
14
14
end
15
15
16
16
function init_module ()
You can’t perform that action at this time.
0 commit comments