pidl:Python: improve the .doc string for the get/set elements
[samba.git] / pidl / lib / Parse / Pidl / Samba4 / Python.pm
index b2b8720493bcbcee6fbe7a397c5cfbb03ca78198..c72d8fe34ec7dc59b2a157143a983c8783817e2f 100644 (file)
@@ -242,7 +242,7 @@ sub PythonStruct($$$$$$)
                        $self->pidl(".name = discard_const_p(char, \"$e->{NAME}\"),");
                        $self->pidl(".get = py_$name\_get_$e->{NAME},");
                        $self->pidl(".set = py_$name\_set_$e->{NAME},");
-                       $self->pidl(".doc = discard_const_p(char, \"PIDL-generated element $e->{NAME}\")");
+                       $self->pidl(".doc = discard_const_p(char, \"PIDL-generated element of base type $e->{TYPE}\")");
                        $self->deindent;
                        $self->pidl("},");
                }
@@ -280,7 +280,7 @@ sub PythonStruct($$$$$$)
                $self->deindent;
                $self->pidl("}");
                $self->pidl("err = ndr_push_struct_blob(&blob, tmp_ctx, object, (ndr_push_flags_fn_t)ndr_push_$name);");
-               $self->pidl("if (err != NDR_ERR_SUCCESS) {");
+               $self->pidl("if (!NDR_ERR_CODE_IS_SUCCESS(err)) {");
                $self->indent;
                $self->pidl("TALLOC_FREE(tmp_ctx);");
                $self->pidl("PyErr_SetNdrError(err);");
@@ -333,7 +333,7 @@ sub PythonStruct($$$$$$)
                $self->pidl("err = ndr_pull_struct_blob_all(&blob, pytalloc_get_mem_ctx(py_obj), object, (ndr_pull_flags_fn_t)ndr_pull_$name);");
                $self->deindent;
                $self->pidl("}");
-               $self->pidl("if (err != NDR_ERR_SUCCESS) {");
+               $self->pidl("if (!NDR_ERR_CODE_IS_SUCCESS(err)) {");
                $self->indent;
                $self->pidl("PyErr_SetNdrError(err);");
                $self->pidl("return NULL;");