Skip to content

Commit 0149c6a

Browse files
committed
Support return values of Python functions
1 parent 0cf56f3 commit 0149c6a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/Inline/Python.pm6

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ multi method run($python, :$file) {
130130
}
131131

132132
method call(Str $package, Str $function, *@args) {
133-
my $array = py_call_function($package, $function, self!setup_arguments(@args));
134-
return Any;
135-
self!unpack_return_values($array);
133+
return self.py_to_p6(py_call_function($package, $function, self!setup_arguments(@args)));
136134
}
137135

138136
method BUILD {

t/call.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def test_int_retvals():
3333
return 3, 1, 2;
3434
3535
def test_str_retval():
36-
return "Hello Perl 6!";
36+
return u"Hello Perl 6!";
3737
3838
def test_mixed_retvals():
39-
return ("Hello", "Perl", 6);
39+
return (u"Hello", u"Perl", 6);
4040
4141
def test_none(undef):
4242
return undef is None;

0 commit comments

Comments
 (0)