diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-10-24 20:59:28 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-10-24 20:59:28 (GMT) |
commit | 9da33ab193803922141f654f6d3cccdaed6b4866 (patch) | |
tree | 316dbe92a8e6cb7a74a0c84c8e90cf00550b582c /Modules/_dbmmodule.c | |
parent | be80fc9a843e3c51d1030d3eab52d6287e5aef3a (diff) | |
download | cpython-9da33ab193803922141f654f6d3cccdaed6b4866.zip cpython-9da33ab193803922141f654f6d3cccdaed6b4866.tar.gz cpython-9da33ab193803922141f654f6d3cccdaed6b4866.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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c index 327b873..83c051c 100644 --- a/Modules/_dbmmodule.c +++ b/Modules/_dbmmodule.c @@ -225,9 +225,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; } |