[3.10] bpo-45060: Get rid of few uses of the equality operators with None (GH-28087). (GH-28092)
(cherry picked from commit 3c65457156d87e55010507d616b4eecb7a02883d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c
index 6ca3ed6..a7fb6a3 100644
--- a/Modules/_gdbmmodule.c
+++ b/Modules/_gdbmmodule.c
@@ -450,7 +450,7 @@ The following code prints every key in the database db, without having
to create a list in memory that contains them all:
k = db.firstkey()
- while k != None:
+ while k is not None:
print(k)
k = db.nextkey(k)
[clinic start generated code]*/
@@ -458,7 +458,7 @@ to create a list in memory that contains them all:
static PyObject *
_gdbm_gdbm_nextkey_impl(gdbmobject *self, PyTypeObject *cls, const char *key,
Py_ssize_clean_t key_length)
-/*[clinic end generated code: output=204964441fdbaf02 input=fcf6a51a96ce0172]*/
+/*[clinic end generated code: output=204964441fdbaf02 input=365e297bc0b3db48]*/
{
PyObject *v;
datum dbm_key, nextkey;
diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h
index ffd2179..ea4ee7d 100644
--- a/Modules/clinic/_gdbmmodule.c.h
+++ b/Modules/clinic/_gdbmmodule.c.h
@@ -161,7 +161,7 @@ PyDoc_STRVAR(_gdbm_gdbm_nextkey__doc__,
"to create a list in memory that contains them all:\n"
"\n"
" k = db.firstkey()\n"
-" while k != None:\n"
+" while k is not None:\n"
" print(k)\n"
" k = db.nextkey(k)");
@@ -340,4 +340,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=e84bc6ac82fcb6d4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3b88446433e43d96 input=a9049054013a1b77]*/