summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-10-03 14:38:12 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-10-03 16:25:37 +0200
commitb7acb8ebb637b29648ae5a6e7043cbf9a6c5ee3a (patch)
tree7a6c412cac58c6bbd4dca6c762f3276f535d175e /pidl
parent9aa90b6cef5d8a6219ab3a6f6f2de55d52f88f62 (diff)
downloadsamba-b7acb8ebb637b29648ae5a6e7043cbf9a6c5ee3a.tar.gz
samba-b7acb8ebb637b29648ae5a6e7043cbf9a6c5ee3a.tar.bz2
samba-b7acb8ebb637b29648ae5a6e7043cbf9a6c5ee3a.zip
pidl: simplify some generated code.
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm6
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 45d33b8055..000f543fa4 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;