summaryrefslogtreecommitdiffstats
path: root/Modules/_dbmmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-10-24 21:01:25 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-10-24 21:01:25 (GMT)
commit124a0b314bcd1e3fb4d768e9f0a95242b0e4e2b3 (patch)
tree6613daade78e7ec142236c425df7fe98b56d27b0 /Modules/_dbmmodule.c
parent7cb11fa89034a06dcad58b65a0321dae9171dbea (diff)
parent9da33ab193803922141f654f6d3cccdaed6b4866 (diff)
downloadcpython-124a0b314bcd1e3fb4d768e9f0a95242b0e4e2b3.zip
cpython-124a0b314bcd1e3fb4d768e9f0a95242b0e4e2b3.tar.gz
cpython-124a0b314bcd1e3fb4d768e9f0a95242b0e4e2b3.tar.bz2
Issue #19287: Fixed the "in" operator of dbm.ndbm databases for string
argument. Original patch by Arfrever Frehtes Taifersar Arahesis.
Diffstat (limited to 'Modules/_dbmmodule.c')
-rw-r--r--Modules/_dbmmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c
index 8babd0e..60802b6 100644
--- a/Modules/_dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -221,9 +221,9 @@ dbm_contains(PyObject *self, PyObject *arg)
if (key.dptr == NULL)
return -1;
}
- if (!PyBytes_Check(arg)) {
+ else if (!PyBytes_Check(arg)) {
PyErr_Format(PyExc_TypeError,
- "dbm key must be string, not %.100s",
+ "dbm key must be bytes or string, not %.100s",
arg->ob_type->tp_name);
return -1;
}