summaryrefslogtreecommitdiff
path: root/source4/build/pidl/swig.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/pidl/swig.pm')
-rw-r--r--source4/build/pidl/swig.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/build/pidl/swig.pm b/source4/build/pidl/swig.pm
index 6442aff005..66cb72dd73 100644
--- a/source4/build/pidl/swig.pm
+++ b/source4/build/pidl/swig.pm
@@ -337,10 +337,10 @@ sub ParseFunction($)
# Output typemap
- $result .= "%typemap(argout) struct $fn->{NAME} * {\n";
+ $result .= "%typemap(argout) struct $fn->{NAME} * (PyObject *temp) {\n";
$result .= "\tTALLOC_CTX *mem_ctx = talloc_init(\"typemap(argout) $fn->{NAME}\");\n\n";
- $result .= "\tresultobj = $fn->{NAME}_ptr_to_python(mem_ctx, \$1";
+ $result .= "\ttemp = $fn->{NAME}_ptr_to_python(mem_ctx, \$1";
foreach my $e (@{$fn->{DATA}}) {
if ((my $switch_is = util::has_property($e, "switch_is"))) {
@@ -349,6 +349,10 @@ sub ParseFunction($)
}
$result .= ");\n\n";
+
+ $result .= "\tPyDict_SetItemString(temp, \"result\", resultobj);\n";
+ $result .= "\tresultobj = temp;\n";
+
$result .= "\ttalloc_free(mem_ctx);\n";
$result .= "}\n\n";