From b7acb8ebb637b29648ae5a6e7043cbf9a6c5ee3a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 3 Oct 2010 14:38:12 +0200 Subject: pidl: simplify some generated code. --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'pidl') 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; -- cgit