From: Jelmer Vernooij Date: Sun, 3 Oct 2010 12:38:12 +0000 (+0200) Subject: pidl: simplify some generated code. X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=b7acb8ebb637b29648ae5a6e7043cbf9a6c5ee3a;p=metze%2Fsamba%2Fwip.git pidl: simplify some generated code. --- diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 45d33b805535..000f543fa431 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;