From 72ded8136b92c1b107f629021cf231fd3163f041 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 22 Jan 2017 23:07:07 +0200 Subject: Issue #28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8() is now of type "const char *" rather of "char *". --- Modules/_dbmmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Modules/_dbmmodule.c') diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c index 804978a6ac..52bdd0b4dd 100644 --- a/Modules/_dbmmodule.c +++ b/Modules/_dbmmodule.c @@ -239,7 +239,7 @@ dbm_contains(PyObject *self, PyObject *arg) return -1; } if (PyUnicode_Check(arg)) { - key.dptr = PyUnicode_AsUTF8AndSize(arg, &size); + key.dptr = (char *)PyUnicode_AsUTF8AndSize(arg, &size); key.dsize = size; if (key.dptr == NULL) return -1; -- cgit v1.2.1 From bfeec6d871e3db2e0ddfdef01387913bc19cadd4 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 23 Jan 2017 09:47:21 +0200 Subject: Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever possible. Patch is writen with Coccinelle. --- Modules/_dbmmodule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Modules/_dbmmodule.c') diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c index 52bdd0b4dd..4b3fac4032 100644 --- a/Modules/_dbmmodule.c +++ b/Modules/_dbmmodule.c @@ -187,8 +187,7 @@ _dbm_dbm_close_impl(dbmobject *self) if (self->di_dbm) dbm_close(self->di_dbm); self->di_dbm = NULL; - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /*[clinic input] -- cgit v1.2.1