Renamed PyString to PyBytes

This commit is contained in:
Christian Heimes 2008-05-26 13:28:38 +00:00
parent 9c4756ea26
commit 72b710a596
78 changed files with 983 additions and 983 deletions

View file

@ -219,14 +219,14 @@ dbm_contains(PyObject *self, PyObject *arg)
if (arg == NULL)
return -1;
}
if (!PyString_Check(arg)) {
if (!PyBytes_Check(arg)) {
PyErr_Format(PyExc_TypeError,
"dbm key must be string, not %.100s",
arg->ob_type->tp_name);
return -1;
}
key.dptr = PyString_AS_STRING(arg);
key.dsize = PyString_GET_SIZE(arg);
key.dptr = PyBytes_AS_STRING(arg);
key.dsize = PyBytes_GET_SIZE(arg);
val = dbm_fetch(dp->di_dbm, key);
return val.dptr != NULL;
}