diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-10-25 00:01:25 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-10-25 00:01:25 +0300 |
commit | 46e1407d34884dae3bbe6cb910a6ec4d39259866 (patch) | |
tree | b74f4b39efebda6ddff7b72a2a93da50a45ad2d3 /Modules/_dbmmodule.c | |
parent | 775f2a79cb9a36549eaf9003803d445b6b7997a8 (diff) | |
parent | 5564b9e3d1febb6fbbde466cc7727240b4ddd412 (diff) | |
download | cpython-46e1407d34884dae3bbe6cb910a6ec4d39259866.tar.gz |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c index 8babd0eb15..60802b694a 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; } |