py: Properly increase the reference counter of Py_None.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 6 Jan 2009 03:13:57 +0000 (04:13 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 6 Jan 2009 03:13:57 +0000 (04:13 +0100)
14 files changed:
lib/tdb/pytdb.c
lib/tevent/pytevent.c
libcli/nbt/pynbt.c
pidl/lib/Parse/Pidl/Samba4/Python.pm
source4/auth/credentials/pycredentials.c
source4/lib/com/pycom.c
source4/lib/ldb/pyldb.c
source4/lib/messaging/pymessaging.c
source4/lib/registry/pyregistry.c
source4/librpc/ndr/py_security.c
source4/librpc/rpc/pyrpc.c
source4/param/pyparam.c
source4/scripting/python/pyglue.c
source4/web_server/wsgi.c

index b7087c4bcc5ca0af5e4f31242bd199bf88f130d9..88f6f4ef73d3051638a3bf103d7ad20d381917c6 100644 (file)
@@ -61,7 +61,7 @@ static TDB_DATA PyString_AsTDB_DATA(PyObject *data)
 static PyObject *PyString_FromTDB_DATA(TDB_DATA data)
 {
        if (data.dptr == NULL && data.dsize == 0) {
-               return Py_None;
+               Py_RETURN_NONE;
        } else {
                PyObject *ret = PyString_FromStringAndSize((const char *)data.dptr, 
                                                                                                   data.dsize);
@@ -103,74 +103,74 @@ static PyObject *obj_transaction_cancel(PyTdbObject *self)
 {
        int ret = tdb_transaction_cancel(self->ctx);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_transaction_commit(PyTdbObject *self)
 {
        int ret = tdb_transaction_commit(self->ctx);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_transaction_recover(PyTdbObject *self)
 {
        int ret = tdb_transaction_recover(self->ctx);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_transaction_start(PyTdbObject *self)
 {
        int ret = tdb_transaction_start(self->ctx);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_reopen(PyTdbObject *self)
 {
        int ret = tdb_reopen(self->ctx);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_lockall(PyTdbObject *self)
 {
        int ret = tdb_lockall(self->ctx);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_unlockall(PyTdbObject *self)
 {
        int ret = tdb_unlockall(self->ctx);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_lockall_read(PyTdbObject *self)
 {
        int ret = tdb_lockall_read(self->ctx);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_unlockall_read(PyTdbObject *self)
 {
        int ret = tdb_unlockall_read(self->ctx);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_close(PyTdbObject *self)
 {
        int ret;
        if (self->closed)
-               return Py_None;
+               Py_RETURN_NONE;
        ret = tdb_close(self->ctx);
        self->closed = true;
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_get(PyTdbObject *self, PyObject *args)
@@ -198,7 +198,7 @@ static PyObject *obj_append(PyTdbObject *self, PyObject *args)
 
        ret = tdb_append(self->ctx, key, data);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_firstkey(PyTdbObject *self)
@@ -229,7 +229,7 @@ static PyObject *obj_delete(PyTdbObject *self, PyObject *args)
        key = PyString_AsTDB_DATA(py_key);
        ret = tdb_delete(self->ctx, key);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *obj_has_key(PyTdbObject *self, PyObject *args)
@@ -264,7 +264,7 @@ static PyObject *obj_store(PyTdbObject *self, PyObject *args)
 
        ret = tdb_store(self->ctx, key, value, flag);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 
@@ -316,7 +316,7 @@ static PyObject *obj_clear(PyTdbObject *self)
 {
        int ret = tdb_wipe_all(self->ctx);
        PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyMethodDef tdb_object_methods[] = {
index 3d71d78397414394b92bb9e675aa54c2445c1fb5..f8e648157dc04544590f36ea1df2796791b5dae5 100644 (file)
@@ -35,7 +35,7 @@ static PyObject *py_set_default_backend(PyObject *self, PyObject *args)
     if (!PyArg_ParseTuple(args, "s", &name))
         return NULL;
     tevent_set_default_backend(name);
-    return Py_None;
+    Py_RETURN_NONE;
 }
 
 static PyObject *py_backend_list(PyObject *self)
index 9afe7ea6c4fb67d0e4105652f2fe393c33384970..8a6d459160102ccf377e3ba6766b8d24742424f4 100644 (file)
@@ -363,7 +363,7 @@ static PyObject *py_nbt_name_refresh(PyObject *self, PyObject *args, PyObject *k
 
 static PyObject *py_nbt_name_release(PyObject *self, PyObject *args, PyObject *kwargs)
 {
-       return Py_None; /* FIXME */
+       Py_RETURN_NONE; /* FIXME */
 }
 
 static PyMethodDef py_nbt_methods[] = {
index 2474bf41a87993cdf8cc1507b3d0dba218c72554..938ea360285c5086f6a75a8050ad4826c87cb436 100644 (file)
@@ -283,7 +283,7 @@ sub PythonStruct($$$$$$)
                $self->deindent;
                $self->pidl("}");
                $self->pidl("");
-               $self->pidl("return Py_None;");
+               $self->pidl("Py_RETURN_NONE;");
                $self->deindent;
                $self->pidl("}");
                $self->pidl("");
index 4fa9fe56963f866b31a5a448f4c651ea550a0d51..903ca2f267a63f0871044c7e99442930a6487f5d 100644 (file)
@@ -37,7 +37,7 @@ struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj)
 static PyObject *PyString_FromStringOrNULL(const char *str)
 {
        if (str == NULL)
-               return Py_None;
+               Py_RETURN_NONE;
        return PyString_FromString(str);
 }
 
@@ -144,7 +144,7 @@ static PyObject *py_creds_is_anonymous(py_talloc_Object *self)
 static PyObject *py_creds_set_anonymous(py_talloc_Object *self)
 {
        cli_credentials_set_anonymous(self->ptr);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_creds_authentication_requested(py_talloc_Object *self)
@@ -170,7 +170,7 @@ static PyObject *py_creds_parse_string(py_talloc_Object *self, PyObject *args)
                return NULL;
 
        cli_credentials_parse_string(self->ptr, newval, obt);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_creds_get_nt_hash(py_talloc_Object *self)
@@ -187,7 +187,7 @@ static PyObject *py_creds_set_kerberos_state(py_talloc_Object *self, PyObject *a
                return NULL;
 
         cli_credentials_set_kerberos_state(self->ptr, state);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_creds_guess(py_talloc_Object *self, PyObject *args)
@@ -203,7 +203,7 @@ static PyObject *py_creds_guess(py_talloc_Object *self, PyObject *args)
 
        cli_credentials_guess(self->ptr, lp_ctx);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_creds_set_machine_account(py_talloc_Object *self, PyObject *args)
@@ -221,7 +221,7 @@ static PyObject *py_creds_set_machine_account(py_talloc_Object *self, PyObject *
        status = cli_credentials_set_machine_account(self->ptr, lp_ctx);
        PyErr_NTSTATUS_IS_ERR_RAISE(status);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyMethodDef py_creds_methods[] = {
index 9222be438dc63044e5adba58c7dd60281e4c8d69..55f1fd21be886a8c7a78e3094c97696c2bed5fa6 100644 (file)
@@ -56,7 +56,7 @@ static PyObject *py_get_class_object(PyObject *self, PyObject *args)
        
        /* FIXME: Magic, integrate with stubs generated by pidl. */
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static struct PyMethodDef com_methods[] = {
index 0dda9aa05bb45e4b023394ad331c821393e3bf41..0bc644716d12b6dff894bf60b774582851b9699d 100644 (file)
@@ -101,7 +101,7 @@ static PyObject *PyLdbResult_FromResult(struct ldb_result *result)
        PyObject *ret;
        int i;
        if (result == NULL) {
-               return Py_None;
+               Py_RETURN_NONE;
        } 
        ret = PyList_New(result->count);
        for (i = 0; i < result->count; i++) {
@@ -370,7 +370,7 @@ static PyObject *py_ldb_set_debug(PyLdbObject *self, PyObject *args)
        /* FIXME: Where do we DECREF cb ? */
        PyErr_LDB_ERROR_IS_ERR_RAISE(ldb_set_debug(self->ldb_ctx, py_ldb_debug, cb), PyLdb_AsLdbContext(self));
        
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_set_create_perms(PyTypeObject *self, PyObject *args)
@@ -381,7 +381,7 @@ static PyObject *py_ldb_set_create_perms(PyTypeObject *self, PyObject *args)
 
        ldb_set_create_perms(PyLdb_AsLdbContext(self), perms);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_set_modules_dir(PyTypeObject *self, PyObject *args)
@@ -392,31 +392,31 @@ static PyObject *py_ldb_set_modules_dir(PyTypeObject *self, PyObject *args)
 
        ldb_set_modules_dir(PyLdb_AsLdbContext(self), modules_dir);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_transaction_start(PyLdbObject *self)
 {
        PyErr_LDB_ERROR_IS_ERR_RAISE(ldb_transaction_start(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_transaction_commit(PyLdbObject *self)
 {
        PyErr_LDB_ERROR_IS_ERR_RAISE(ldb_transaction_commit(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_transaction_cancel(PyLdbObject *self)
 {
        PyErr_LDB_ERROR_IS_ERR_RAISE(ldb_transaction_cancel(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_setup_wellknown_attributes(PyLdbObject *self)
 {
        PyErr_LDB_ERROR_IS_ERR_RAISE(ldb_setup_wellknown_attributes(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_repr(PyLdbObject *self)
@@ -428,7 +428,7 @@ static PyObject *py_ldb_get_root_basedn(PyLdbObject *self)
 {
        struct ldb_dn *dn = ldb_get_root_basedn(PyLdb_AsLdbContext(self));
        if (dn == NULL)
-               return Py_None;
+               Py_RETURN_NONE;
        return PyLdbDn_FromDn(dn);
 }
 
@@ -437,7 +437,7 @@ static PyObject *py_ldb_get_schema_basedn(PyLdbObject *self)
 {
        struct ldb_dn *dn = ldb_get_schema_basedn(PyLdb_AsLdbContext(self));
        if (dn == NULL)
-               return Py_None;
+               Py_RETURN_NONE;
        return PyLdbDn_FromDn(dn);
 }
 
@@ -446,7 +446,7 @@ static PyObject *py_ldb_get_config_basedn(PyLdbObject *self)
 {
        struct ldb_dn *dn = ldb_get_config_basedn(PyLdb_AsLdbContext(self));
        if (dn == NULL)
-               return Py_None;
+               Py_RETURN_NONE;
        return PyLdbDn_FromDn(dn);
 }
 
@@ -455,7 +455,7 @@ static PyObject *py_ldb_get_default_basedn(PyLdbObject *self)
 {
        struct ldb_dn *dn = ldb_get_default_basedn(PyLdb_AsLdbContext(self));
        if (dn == NULL)
-               return Py_None;
+               Py_RETURN_NONE;
        return PyLdbDn_FromDn(dn);
 }
 
@@ -560,7 +560,7 @@ static PyObject *py_ldb_connect(PyLdbObject *self, PyObject *args, PyObject *kwa
 
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, PyLdb_AsLdbContext(self));
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_modify(PyLdbObject *self, PyObject *args)
@@ -578,7 +578,7 @@ static PyObject *py_ldb_modify(PyLdbObject *self, PyObject *args)
        ret = ldb_modify(PyLdb_AsLdbContext(self), PyLdbMessage_AsMessage(py_msg));
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, PyLdb_AsLdbContext(self));
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_add(PyLdbObject *self, PyObject *args)
@@ -635,7 +635,7 @@ static PyObject *py_ldb_add(PyLdbObject *self, PyObject *args)
        ret = ldb_add(PyLdb_AsLdbContext(self), msg);
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, PyLdb_AsLdbContext(self));
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 
@@ -657,7 +657,7 @@ static PyObject *py_ldb_delete(PyLdbObject *self, PyObject *args)
        ret = ldb_delete(ldb, dn);
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, ldb);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_rename(PyLdbObject *self, PyObject *args)
@@ -679,7 +679,7 @@ static PyObject *py_ldb_rename(PyLdbObject *self, PyObject *args)
        ret = ldb_rename(ldb, dn1, dn2);
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, ldb);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_schema_attribute_remove(PyLdbObject *self, PyObject *args)
@@ -690,7 +690,7 @@ static PyObject *py_ldb_schema_attribute_remove(PyLdbObject *self, PyObject *arg
 
        ldb_schema_attribute_remove(PyLdb_AsLdbContext(self), name);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_schema_attribute_add(PyLdbObject *self, PyObject *args)
@@ -705,13 +705,13 @@ static PyObject *py_ldb_schema_attribute_add(PyLdbObject *self, PyObject *args)
 
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, PyLdb_AsLdbContext(self));
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *ldb_ldif_to_pyobject(struct ldb_ldif *ldif)
 {
        if (ldif == NULL) {
-               return Py_None;
+               Py_RETURN_NONE;
        } else {
        /* We don't want this attached to the 'ldb' any more */
                talloc_steal(NULL, ldif);
@@ -758,12 +758,12 @@ static PyObject *py_ldb_schema_format_value(PyLdbObject *self, PyObject *args)
        a = ldb_schema_attribute_by_name(PyLdb_AsLdbContext(self), element_name);
 
        if (a == NULL) {
-               return Py_None;
+               Py_RETURN_NONE;
        }
        
        if (a->syntax->ldif_write_fn(PyLdb_AsLdbContext(self), mem_ctx, &old_val, &new_val) != 0) {
                talloc_free(mem_ctx);
-               return Py_None;
+               Py_RETURN_NONE;
        }
 
        ret = PyString_FromStringAndSize((const char *)new_val.data, new_val.length);
@@ -862,7 +862,7 @@ static PyObject *py_ldb_get_opaque(PyLdbObject *self, PyObject *args)
        data = ldb_get_opaque(PyLdb_AsLdbContext(self), name);
 
        if (data == NULL)
-               return Py_None;
+               Py_RETURN_NONE;
 
        /* FIXME: More interpretation */
 
@@ -881,7 +881,7 @@ static PyObject *py_ldb_set_opaque(PyLdbObject *self, PyObject *args)
 
        ldb_set_opaque(PyLdb_AsLdbContext(self), name, data);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_modules(PyLdbObject *self)
@@ -1077,19 +1077,19 @@ static PyObject *py_ldb_module_str(PyLdbModuleObject *self)
 static PyObject *py_ldb_module_start_transaction(PyLdbModuleObject *self)
 {
        PyLdbModule_AsModule(self)->ops->start_transaction(PyLdbModule_AsModule(self));
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_module_end_transaction(PyLdbModuleObject *self)
 {
        PyLdbModule_AsModule(self)->ops->end_transaction(PyLdbModule_AsModule(self));
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_module_del_transaction(PyLdbModuleObject *self)
 {
        PyLdbModule_AsModule(self)->ops->del_transaction(PyLdbModule_AsModule(self));
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_module_search(PyLdbModuleObject *self, PyObject *args, PyObject *kwargs)
@@ -1138,7 +1138,7 @@ static PyObject *py_ldb_module_add(PyLdbModuleObject *self, PyObject *args)
 
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, mod->ldb);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_module_modify(PyLdbModuleObject *self, PyObject *args) 
@@ -1160,7 +1160,7 @@ static PyObject *py_ldb_module_modify(PyLdbModuleObject *self, PyObject *args)
 
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, mod->ldb);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_module_delete(PyLdbModuleObject *self, PyObject *args) 
@@ -1180,7 +1180,7 @@ static PyObject *py_ldb_module_delete(PyLdbModuleObject *self, PyObject *args)
 
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, NULL);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_module_rename(PyLdbModuleObject *self, PyObject *args)
@@ -1202,7 +1202,7 @@ static PyObject *py_ldb_module_rename(PyLdbModuleObject *self, PyObject *args)
 
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, NULL);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyMethodDef py_ldb_module_methods[] = {
@@ -1295,7 +1295,7 @@ static PyObject *py_ldb_msg_element_get(PyLdbMessageElementObject *self, PyObjec
        if (!PyArg_ParseTuple(args, "i", &i))
                return NULL;
        if (i < 0 || i >= PyLdbMessageElement_AsMessageElement(self)->num_values)
-               return Py_None;
+               Py_RETURN_NONE;
 
        return PyObject_FromLdbValue(NULL, PyLdbMessageElement_AsMessageElement(self), 
                                                                 &(PyLdbMessageElement_AsMessageElement(self)->values[i]));
@@ -1434,7 +1434,7 @@ static PyObject *py_ldb_msg_element_str(PyLdbMessageElementObject *self)
        if (el->num_values == 1)
                return PyString_FromStringAndSize((char *)el->values[0].data, el->values[0].length);
        else 
-               return Py_None;
+               Py_RETURN_NONE;
 }
 
 static void py_ldb_msg_element_dealloc(PyLdbMessageElementObject *self)
@@ -1465,7 +1465,7 @@ static PyObject *py_ldb_msg_remove_attr(PyLdbMessageObject *self, PyObject *args
 
        ldb_msg_remove_attr(self->msg, name);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_msg_keys(PyLdbMessageObject *self)
@@ -1516,7 +1516,7 @@ static PyObject *py_ldb_msg_get(PyLdbMessageObject *self, PyObject *args)
 
        ret = py_ldb_msg_getitem_helper(self, name);
        if (ret == NULL)
-               return Py_None;
+               Py_RETURN_NONE;
        return ret;
 }
 
@@ -1980,7 +1980,7 @@ static PyObject *py_register_module(PyObject *module, PyObject *args)
 
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, NULL);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_timestring(PyObject *module, PyObject *args)
index 9cc14b4381d91c2fecf0993c6ab9ca47bc46ab0a..4b092e873aef40a3f14d149d72386dc9643c5779 100644 (file)
@@ -152,7 +152,7 @@ static PyObject *py_messaging_send(PyObject *self, PyObject *args, PyObject *kwa
                return NULL;
        }
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static void py_msg_callback_wrapper(struct messaging_context *msg, void *private, 
@@ -214,7 +214,7 @@ static PyObject *py_messaging_deregister(PyObject *self, PyObject *args, PyObjec
 
        Py_DECREF(callback);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_messaging_add_name(PyObject *self, PyObject *args, PyObject *kwargs)
@@ -235,7 +235,7 @@ static PyObject *py_messaging_add_name(PyObject *self, PyObject *args, PyObject
                return NULL;
        }
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 
@@ -252,7 +252,7 @@ static PyObject *py_messaging_remove_name(PyObject *self, PyObject *args, PyObje
 
        irpc_remove_name(iface->msg_ctx, name);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyMethodDef py_messaging_methods[] = {
index 357305c4de35316db5cca8054330ceeba5e08240..444b80a6fef7986fcc7f9b2782b454a4ff718bec 100644 (file)
@@ -60,7 +60,7 @@ static PyObject *py_key_del_abs(PyObject *self, PyObject *args)
        result = reg_key_del_abs(ctx, path);
        PyErr_WERROR_IS_ERR_RAISE(result);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_get_predefined_key(PyObject *self, PyObject *args)
@@ -90,7 +90,7 @@ static PyObject *py_diff_apply(PyObject *self, PyObject *args)
        result = reg_diff_apply(ctx, py_iconv_convenience(NULL), filename);
        PyErr_WERROR_IS_ERR_RAISE(result);
 
-       return Py_None
+       Py_RETURN_NONE
 }
 
 static PyObject *py_mount_hive(PyObject *self, PyObject *args)
@@ -123,7 +123,7 @@ static PyObject *py_mount_hive(PyObject *self, PyObject *args)
        result = reg_mount_hive(ctx, py_talloc_get_ptr(py_hivekey), hkey, elements);
        PyErr_WERROR_IS_ERR_RAISE(result);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *registry_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
@@ -172,7 +172,7 @@ static PyObject *py_hive_key_del(PyObject *self, PyObject *args)
 
        PyErr_WERROR_IS_ERR_RAISE(result);
 
-       return Py_None
+       Py_RETURN_NONE
 }
 
 static PyObject *py_hive_key_flush(PyObject *self)
@@ -183,7 +183,7 @@ static PyObject *py_hive_key_flush(PyObject *self)
        result = hive_key_flush(key);
        PyErr_WERROR_IS_ERR_RAISE(result);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_hive_key_del_value(PyObject *self, PyObject *args)
@@ -199,7 +199,7 @@ static PyObject *py_hive_key_del_value(PyObject *self, PyObject *args)
 
        PyErr_WERROR_IS_ERR_RAISE(result);
 
-       return Py_None
+       Py_RETURN_NONE
 }
 
 static PyObject *py_hive_key_set_value(PyObject *self, PyObject *args)
@@ -220,7 +220,7 @@ static PyObject *py_hive_key_set_value(PyObject *self, PyObject *args)
 
        PyErr_WERROR_IS_ERR_RAISE(result);
 
-       return Py_None
+       Py_RETURN_NONE
 }
 
 static PyMethodDef hive_key_methods[] = {
@@ -238,7 +238,7 @@ static PyMethodDef hive_key_methods[] = {
 static PyObject *hive_open(PyTypeObject *type, PyObject *args, PyObject *kwargs)
 {
        /* reg_open_hive */
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 PyTypeObject PyHiveKey = {
@@ -383,7 +383,7 @@ static PyObject *py_get_predef_name(PyObject *self, PyObject *args)
 
        str = reg_get_predef_name(hkey);
        if (str == NULL)
-               return Py_None;
+               Py_RETURN_NONE;
        return PyString_FromString(str);
 }
 
index 5100517c57f76f137e844b0179e74c2fb6805d65..73837b67ef8cb0b5acf9a919d5c107ce506870f9 100644 (file)
@@ -100,7 +100,7 @@ static PyObject *py_descriptor_sacl_add(PyObject *self, PyObject *args)
        ace = py_talloc_get_ptr(py_ace);
        status = security_descriptor_sacl_add(desc, ace);
        PyErr_NTSTATUS_IS_ERR_RAISE(status);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_descriptor_dacl_add(PyObject *self, PyObject *args)
@@ -117,7 +117,7 @@ static PyObject *py_descriptor_dacl_add(PyObject *self, PyObject *args)
 
        status = security_descriptor_dacl_add(desc, ace);
        PyErr_NTSTATUS_IS_ERR_RAISE(status);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_descriptor_dacl_del(PyObject *self, PyObject *args)
@@ -133,7 +133,7 @@ static PyObject *py_descriptor_dacl_del(PyObject *self, PyObject *args)
        sid = py_talloc_get_ptr(py_sid);
        status = security_descriptor_dacl_del(desc, sid);
        PyErr_NTSTATUS_IS_ERR_RAISE(status);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_descriptor_sacl_del(PyObject *self, PyObject *args)
@@ -149,7 +149,7 @@ static PyObject *py_descriptor_sacl_del(PyObject *self, PyObject *args)
        sid = py_talloc_get_ptr(py_sid);
        status = security_descriptor_sacl_del(desc, sid);
        PyErr_NTSTATUS_IS_ERR_RAISE(status);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_descriptor_new(PyTypeObject *self, PyObject *args, PyObject *kwargs)
@@ -252,7 +252,7 @@ static PyObject *py_token_set_privilege(PyObject *self, PyObject *args)
                return NULL;
 
        security_token_set_privilege(token, priv);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_token_new(PyTypeObject *self, PyObject *args, PyObject *kwargs)
index a15c3eaac0fa8857f7ace89d5c8a7e65d0c5069e..9863a6aeb55c499929e8e4c4f8165017112902ac 100644 (file)
@@ -144,7 +144,7 @@ static PyObject *py_iface_server_name(PyObject *obj, void *closure)
        
        server_name = dcerpc_server_name(iface->pipe);
        if (server_name == NULL)
-               return Py_None;
+               Py_RETURN_NONE;
 
        return PyString_FromString(server_name);
 }
@@ -284,7 +284,7 @@ static PyObject *py_iface_alter_context(PyObject *self, PyObject *args, PyObject
                return NULL;
        }
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, PyObject *kwargs, const struct ndr_interface_table *table)
index 69c2613a0994276319cc21ff38192682ff21ba73..f6a0b4f6749ba30c1f826d6c26cb8d9793340ebf 100644 (file)
@@ -150,7 +150,7 @@ static PyObject *py_lp_ctx_load(py_talloc_Object *self, PyObject *args)
                PyErr_Format(PyExc_RuntimeError, "Unable to load file %s", filename);
                return NULL;
        }
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_lp_ctx_load_default(py_talloc_Object *self)
@@ -162,7 +162,7 @@ static PyObject *py_lp_ctx_load_default(py_talloc_Object *self)
                PyErr_SetString(PyExc_RuntimeError, "Unable to load default file");
                return NULL;
        }
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_lp_ctx_get(py_talloc_Object *self, PyObject *args)
@@ -175,7 +175,7 @@ static PyObject *py_lp_ctx_get(py_talloc_Object *self, PyObject *args)
 
        ret = py_lp_ctx_get_helper(self->ptr, section_name, param_name);
        if (ret == NULL)
-               return Py_None;
+               Py_RETURN_NONE;
        return ret;
 }
 
@@ -210,7 +210,7 @@ static PyObject *py_lp_ctx_set(py_talloc_Object *self, PyObject *args)
                return NULL;
         }
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_lp_ctx_private_path(py_talloc_Object *self, PyObject *args)
index 24ffd58cafabcb8f9f3d6e8953f9318706d32821..6939979f18f4fdc77382c8ce4e5603acd7f1a814 100644 (file)
@@ -88,7 +88,7 @@ static PyObject *py_ldb_set_credentials(PyObject *self, PyObject *args)
 
        ldb_set_opaque(ldb, "credentials", creds);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_set_loadparm(PyObject *self, PyObject *args)
@@ -109,7 +109,7 @@ static PyObject *py_ldb_set_loadparm(PyObject *self, PyObject *args)
 
        ldb_set_opaque(ldb, "loadparm", lp_ctx);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 
@@ -131,7 +131,7 @@ static PyObject *py_ldb_set_session_info(PyObject *self, PyObject *args)
 
        ldb_set_opaque(ldb, "sessionInfo", info);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_samdb_set_domain_sid(PyLdbObject *self, PyObject *args)
@@ -153,7 +153,7 @@ static PyObject *py_samdb_set_domain_sid(PyLdbObject *self, PyObject *args)
                PyErr_SetString(PyExc_RuntimeError, "set_domain_sid failed");
                return NULL;
        } 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_ldb_register_samba_handlers(PyObject *self, PyObject *args)
@@ -169,7 +169,7 @@ static PyObject *py_ldb_register_samba_handlers(PyObject *self, PyObject *args)
        ret = ldb_register_samba_handlers(ldb);
 
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, ldb);
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_dsdb_set_ntds_invocation_id(PyObject *self, PyObject *args)
@@ -189,7 +189,7 @@ static PyObject *py_dsdb_set_ntds_invocation_id(PyObject *self, PyObject *args)
                PyErr_SetString(PyExc_RuntimeError, "set_ntds_invocation_id failed");
                return NULL;
        }
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_dsdb_set_global_schema(PyObject *self, PyObject *args)
@@ -205,7 +205,7 @@ static PyObject *py_dsdb_set_global_schema(PyObject *self, PyObject *args)
        ret = dsdb_set_global_schema(ldb);
        PyErr_LDB_ERROR_IS_ERR_RAISE(ret, ldb);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_dsdb_attach_schema_from_ldif_file(PyObject *self, PyObject *args)
@@ -223,7 +223,7 @@ static PyObject *py_dsdb_attach_schema_from_ldif_file(PyObject *self, PyObject *
        result = dsdb_attach_schema_from_ldif_file(ldb, pf, df);
        PyErr_WERROR_IS_ERR_RAISE(result);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyMethodDef py_misc_methods[] = {
index 9b660ff3627e80d3913b8d9895019ec04d442541..762de55f695c2ede4cfe7a8000c0d9f73a7ffd9b 100644 (file)
@@ -90,7 +90,7 @@ static PyObject *start_response(PyObject *self, PyObject *args, PyObject *kwargs
 
        websrv_output_headers(web, status, headers);
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyMethodDef web_request_methods[] = {
@@ -114,7 +114,7 @@ typedef struct {
 static PyObject *py_error_flush(PyObject *self, PyObject *args, PyObject *kwargs)
 {
        /* Nothing to do here */
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_error_write(PyObject *self, PyObject *args, PyObject *kwargs)
@@ -128,7 +128,7 @@ static PyObject *py_error_write(PyObject *self, PyObject *args, PyObject *kwargs
 
        DEBUG(0, ("WSGI App: %s", str));
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyObject *py_error_writelines(PyObject *self, PyObject *args, PyObject *kwargs)
@@ -146,7 +146,7 @@ static PyObject *py_error_writelines(PyObject *self, PyObject *args, PyObject *k
                DEBUG(0, ("WSGI App: %s", str));
        }
 
-       return Py_None;
+       Py_RETURN_NONE;
 }
 
 static PyMethodDef error_Stream_methods[] = {