svn commit: samba r2496 - in branches/SAMBA_4_0/source/build/pidl: .

tpot at samba.org tpot at samba.org
Wed Sep 22 05:14:16 GMT 2004


Author: tpot
Date: 2004-09-22 05:14:15 +0000 (Wed, 22 Sep 2004)
New Revision: 2496

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/build/pidl&rev=2496&nolog=1

Log:
Check that reference parameters are not None.

Modified:
   branches/SAMBA_4_0/source/build/pidl/swig.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/pidl/swig.pm
===================================================================
--- branches/SAMBA_4_0/source/build/pidl/swig.pm	2004-09-22 05:13:32 UTC (rev 2495)
+++ branches/SAMBA_4_0/source/build/pidl/swig.pm	2004-09-22 05:14:15 UTC (rev 2496)
@@ -261,7 +261,15 @@
     $result .= "\tmemset(s, 0, sizeof(struct $fn->{NAME}));\n\n";
 
     foreach my $e (@{$fn->{DATA}}) {
-	$result .= FieldFromPython($e, "in.") if util::has_property($e, "in")
+	if (util::has_property($e, "in")) {
+	    if (util::has_property($e, "ref")) {
+		$result .= "\tif (PyDict_GetItemString(obj, \"$e->{NAME}\") == Py_None) {\n";
+		$result .= "\t\tPyErr_Format(PyExc_ValueError, \"Key '$e->{NAME}' cannot be None\");\n";
+		$result .= "\t\treturn NULL;\n";
+		$result .= "\t}\n";
+	    }
+	    $result .= FieldFromPython($e, "in.") ;
+	}
     }
 
     $result .= "\n";



More information about the samba-cvs mailing list