pidl: simplify some generated code.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 3 Oct 2010 12:38:12 +0000 (14:38 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 3 Oct 2010 14:25:37 +0000 (16:25 +0200)
pidl/lib/Parse/Pidl/Samba4/Python.pm

index 45d33b8055353ca4911cd242e805764aed989bfc..000f543fa431c8869d91c431f6483004bfbaec85 100644 (file)
@@ -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;