diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-07-30 20:28:29 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-07-30 20:28:29 +0200 |
commit | 8eff9f9a3167eb0c2a4c00edf5a4cdbbc06c4dfd (patch) | |
tree | 9900fed04e613bad700608b9d12b681ad447545b /pidl/lib | |
parent | 6768cfe624fffef13109989e9cc79ccb4df13d19 (diff) | |
download | samba-8eff9f9a3167eb0c2a4c00edf5a4cdbbc06c4dfd.tar.gz |
python: Cope with the dom_sid2 alias in pidl's python generating code.
This fixes some problems in the samr Python bindings that pidl was
(correctly) warning about.
Diffstat (limited to 'pidl/lib')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/Python.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 462f8333e1..78a4ebdb5f 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -766,6 +766,11 @@ sub register_module_import($$) sub use_type_variable($$) { my ($self, $orig_ctype) = @_; + # FIXME: Have a global lookup table for types that look different on the + # wire than they are named in C? + if ($orig_ctype->{NAME} eq "dom_sid2") { + $orig_ctype->{NAME} = "dom_sid"; + } my $ctype = resolveType($orig_ctype); unless (defined($ctype->{BASEFILE})) { return undef; @@ -840,8 +845,7 @@ sub ConvertObjectFromPythonData($$$$$$;$) my $ctype_name = $self->use_type_variable($ctype); unless (defined ($ctype_name)) { error($location, "Unable to determine origin of type `" . mapTypeName($ctype) . "'"); - $self->assign($target, "NULL"); - # FIXME: + $self->pidl("PyErr_SetString(PyExc_TypeError, \"Can not convert C Type " . mapType($ctype) . " to Python\");"); return; } $self->pidl("PY_CHECK_TYPE($ctype_name, $cvar, $fail);"); |