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);
{
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)
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)
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)
ret = tdb_store(self->ctx, key, value, flag);
PyErr_TDB_ERROR_IS_ERR_RAISE(ret, self->ctx);
- return Py_None;
+ Py_RETURN_NONE;
}
{
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[] = {
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)
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[] = {
$self->deindent;
$self->pidl("}");
$self->pidl("");
- $self->pidl("return Py_None;");
+ $self->pidl("Py_RETURN_NONE;");
$self->deindent;
$self->pidl("}");
$self->pidl("");
static PyObject *PyString_FromStringOrNULL(const char *str)
{
if (str == NULL)
- return Py_None;
+ Py_RETURN_NONE;
return PyString_FromString(str);
}
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)
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)
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)
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)
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[] = {
/* FIXME: Magic, integrate with stubs generated by pidl. */
- return Py_None;
+ Py_RETURN_NONE;
}
static struct PyMethodDef com_methods[] = {
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++) {
/* 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)
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)
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)
{
struct ldb_dn *dn = ldb_get_root_basedn(PyLdb_AsLdbContext(self));
if (dn == NULL)
- return Py_None;
+ Py_RETURN_NONE;
return PyLdbDn_FromDn(dn);
}
{
struct ldb_dn *dn = ldb_get_schema_basedn(PyLdb_AsLdbContext(self));
if (dn == NULL)
- return Py_None;
+ Py_RETURN_NONE;
return PyLdbDn_FromDn(dn);
}
{
struct ldb_dn *dn = ldb_get_config_basedn(PyLdb_AsLdbContext(self));
if (dn == NULL)
- return Py_None;
+ Py_RETURN_NONE;
return PyLdbDn_FromDn(dn);
}
{
struct ldb_dn *dn = ldb_get_default_basedn(PyLdb_AsLdbContext(self));
if (dn == NULL)
- return Py_None;
+ Py_RETURN_NONE;
return PyLdbDn_FromDn(dn);
}
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)
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)
ret = ldb_add(PyLdb_AsLdbContext(self), msg);
PyErr_LDB_ERROR_IS_ERR_RAISE(ret, PyLdb_AsLdbContext(self));
- return Py_None;
+ Py_RETURN_NONE;
}
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)
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)
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)
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);
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);
data = ldb_get_opaque(PyLdb_AsLdbContext(self), name);
if (data == NULL)
- return Py_None;
+ Py_RETURN_NONE;
/* FIXME: More interpretation */
ldb_set_opaque(PyLdb_AsLdbContext(self), name, data);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *py_ldb_modules(PyLdbObject *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)
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)
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)
PyErr_LDB_ERROR_IS_ERR_RAISE(ret, NULL);
- return Py_None;
+ Py_RETURN_NONE;
}
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[] = {
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]));
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)
ldb_msg_remove_attr(self->msg, name);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *py_ldb_msg_keys(PyLdbMessageObject *self)
ret = py_ldb_msg_getitem_helper(self, name);
if (ret == NULL)
- return Py_None;
+ Py_RETURN_NONE;
return ret;
}
PyErr_LDB_ERROR_IS_ERR_RAISE(ret, NULL);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *py_timestring(PyObject *module, PyObject *args)
return NULL;
}
- return Py_None;
+ Py_RETURN_NONE;
}
static void py_msg_callback_wrapper(struct messaging_context *msg, void *private,
Py_DECREF(callback);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *py_messaging_add_name(PyObject *self, PyObject *args, PyObject *kwargs)
return NULL;
}
- return Py_None;
+ Py_RETURN_NONE;
}
irpc_remove_name(iface->msg_ctx, name);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyMethodDef py_messaging_methods[] = {
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)
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)
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)
PyErr_WERROR_IS_ERR_RAISE(result);
- return Py_None;
+ Py_RETURN_NONE;
}
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)
PyErr_WERROR_IS_ERR_RAISE(result);
- return Py_None;
+ Py_RETURN_NONE;
}
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[] = {
static PyObject *hive_open(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
/* reg_open_hive */
- return Py_None;
+ Py_RETURN_NONE;
}
PyTypeObject PyHiveKey = {
str = reg_get_predef_name(hkey);
if (str == NULL)
- return Py_None;
+ Py_RETURN_NONE;
return PyString_FromString(str);
}
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)
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)
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)
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)
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)
server_name = dcerpc_server_name(iface->pipe);
if (server_name == NULL)
- return Py_None;
+ Py_RETURN_NONE;
return PyString_FromString(server_name);
}
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)
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)
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)
ret = py_lp_ctx_get_helper(self->ptr, section_name, param_name);
if (ret == NULL)
- return Py_None;
+ Py_RETURN_NONE;
return ret;
}
return NULL;
}
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *py_lp_ctx_private_path(py_talloc_Object *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)
ldb_set_opaque(ldb, "loadparm", lp_ctx);
- return Py_None;
+ Py_RETURN_NONE;
}
ldb_set_opaque(ldb, "sessionInfo", info);
- return Py_None;
+ Py_RETURN_NONE;
}
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)
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)
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)
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)
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[] = {
websrv_output_headers(web, status, headers);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyMethodDef web_request_methods[] = {
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)
DEBUG(0, ("WSGI App: %s", str));
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *py_error_writelines(PyObject *self, PyObject *args, PyObject *kwargs)
DEBUG(0, ("WSGI App: %s", str));
}
- return Py_None;
+ Py_RETURN_NONE;
}
static PyMethodDef error_Stream_methods[] = {