pidl:Samba4/Python.pm: use PyString_FromStringOrNULL() from pyrpc_util
authorStefan Metzmacher <metze@samba.org>
Wed, 8 Dec 2010 14:08:45 +0000 (15:08 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 8 Dec 2010 18:07:09 +0000 (19:07 +0100)
metze

pidl/lib/Parse/Pidl/Samba4/Python.pm

index 3e9178b..1ed75ae 100644 (file)
@@ -1107,19 +1107,19 @@ sub ConvertScalarToPython($$$)
        }
 
        if (($ctypename eq "string" or $ctypename eq "nbt_string" or $ctypename eq "nbt_name" or $ctypename eq "wrepl_nbt_name")) {
-               return "PyString_FromString_check_null($cvar)";
+               return "PyString_FromStringOrNULL($cvar)";
        }
 
        if (($ctypename eq "dns_string" or $ctypename eq "dns_name")) {
-               return "PyString_FromString_check_null($cvar)";
+               return "PyString_FromStringOrNULL($cvar)";
        }
 
        # Not yet supported
        if ($ctypename eq "string_array") { return "PyCObject_FromTallocPtr($cvar)"; }
-       if ($ctypename eq "ipv4address") { return "PyString_FromString_check_null($cvar)"; }
-       if ($ctypename eq "ipv6address") { return "PyString_FromString_check_null($cvar)"; }
-       if ($ctypename eq "dnsp_name") { return "PyString_FromString_check_null($cvar)"; }
-       if ($ctypename eq "dnsp_string") { return "PyString_FromString_check_null($cvar)"; }
+       if ($ctypename eq "ipv4address") { return "PyString_FromStringOrNULL($cvar)"; }
+       if ($ctypename eq "ipv6address") { return "PyString_FromStringOrNULL($cvar)"; }
+       if ($ctypename eq "dnsp_name") { return "PyString_FromStringOrNULL($cvar)"; }
+       if ($ctypename eq "dnsp_string") { return "PyString_FromStringOrNULL($cvar)"; }
        if ($ctypename eq "pointer") {
                return "PyCObject_FromTallocPtr($cvar)";
        }