Commit 63bcb2f5 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #19287: Fixed the "in" operator of dbm.ndbm databases for string

argument.  Original patch by Arfrever Frehtes Taifersar Arahesis.
parent f2e07046
......@@ -24,6 +24,7 @@ class DbmTestCase(unittest.TestCase):
self.d[b'bytes'] = b'data'
self.d['12345678910'] = '019237410982340912840198242'
self.d.keys()
self.assertIn('a', self.d)
self.assertIn(b'a', self.d)
self.assertEqual(self.d[b'bytes'], b'data')
self.d.close()
......
......@@ -81,6 +81,9 @@ Core and Builtins
Library
-------
- Issue #19287: Fixed the "in" operator of dbm.ndbm databases for string
argument. Original patch by Arfrever Frehtes Taifersar Arahesis.
- Issue #19327: Fixed the working of regular expressions with too big charset.
- Issue #19350: Increasing the test coverage of macurl2path. Patch by Colin
......
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment