diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-10-03 14:38:12 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-10-03 16:25:37 +0200 |
commit | b7acb8ebb637b29648ae5a6e7043cbf9a6c5ee3a (patch) | |
tree | 7a6c412cac58c6bbd4dca6c762f3276f535d175e /pidl | |
parent | 9aa90b6cef5d8a6219ab3a6f6f2de55d52f88f62 (diff) | |
download | samba-b7acb8ebb637b29648ae5a6e7043cbf9a6c5ee3a.tar.gz |
pidl: simplify some generated code.
Diffstat (limited to 'pidl')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba4/Python.pm | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 45d33b80553..000f543fa43 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -850,13 +850,11 @@ sub ConvertObjectFromPythonData($$$$$$;$) } if ($actual_ctype->{TYPE} eq "SCALAR" ) { if (expandAlias($actual_ctype->{NAME}) =~ /^(u?int64|hyper|dlong|udlong|udlongr|NTTIME_hyper|NTTIME|NTTIME_1sec)$/) { - $self->pidl("if (PyObject_TypeCheck($cvar, &PyLong_Type)) {"); + $self->pidl("if (PyLong_Check($cvar)) {"); $self->indent; $self->pidl("$target = PyLong_AsLongLong($cvar);"); $self->deindent; - $self->pidl("} else {"); - $self->indent; - $self->pidl("if (PyObject_TypeCheck($cvar, &PyInt_Type)) {"); + $self->pidl("} else if (PyInt_Check($cvar)) {"); $self->indent; $self->pidl("$target = PyInt_AsLong($cvar);"); $self->deindent; |