mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #19287: Fixed the "in" operator of dbm.ndbm databases for string
argument. Original patch by Arfrever Frehtes Taifersar Arahesis.
This commit is contained in:
commit
124a0b314b
3 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue