summaryrefslogtreecommitdiffstats
path: root/Modules/_dbmmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_dbmmodule.c')
-rw-r--r--Modules/_dbmmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c
index 8484d94..ddfd4cd 100644
--- a/Modules/_dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -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;
}