summaryrefslogtreecommitdiffstats
path: root/Modules/_gdbmmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-23 07:47:21 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-23 07:47:21 (GMT)
commit228b12edcce49649d6befa3c03dbcefd5a22ae76 (patch)
tree1066be6909fb981fcf30e1a8e224d43567bd9b92 /Modules/_gdbmmodule.c
parent60e6e962bac6a668d0df539ebf526a0a1c69eacd (diff)
downloadcpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.zip
cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.gz
cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.bz2
Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
Diffstat (limited to 'Modules/_gdbmmodule.c')
-rw-r--r--Modules/_gdbmmodule.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c
index b727ba6..54a6566 100644
--- a/Modules/_gdbmmodule.c
+++ b/Modules/_gdbmmodule.c
@@ -255,8 +255,7 @@ _gdbm_gdbm_close_impl(dbmobject *self)
if (self->di_dbm)
gdbm_close(self->di_dbm);
self->di_dbm = NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/* XXX Should return a set or a set view */
@@ -375,8 +374,7 @@ _gdbm_gdbm_firstkey_impl(dbmobject *self)
return v;
}
else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -415,8 +413,7 @@ _gdbm_gdbm_nextkey_impl(dbmobject *self, const char *key,
return v;
}
else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -445,8 +442,7 @@ _gdbm_gdbm_reorganize_impl(dbmobject *self)
PyErr_SetString(DbmError, gdbm_strerror(gdbm_errno));
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
/*[clinic input]
@@ -464,8 +460,7 @@ _gdbm_gdbm_sync_impl(dbmobject *self)
{
check_dbmobject_open(self);
gdbm_sync(self->di_dbm);
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *