diff options
author | Christian Heimes <christian@cheimes.de> | 2008-05-26 13:28:38 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-05-26 13:28:38 (GMT) |
commit | 72b710a59617ebe6dd1c41613d2c7eb81702efd9 (patch) | |
tree | cd134cc11c49ba09f50e44a9f36b69f2b0ffc893 /Modules/_gdbmmodule.c | |
parent | 9c4756ea265b5ebd71c9ae59f3673c7cecb6f060 (diff) | |
download | cpython-72b710a59617ebe6dd1c41613d2c7eb81702efd9.zip cpython-72b710a59617ebe6dd1c41613d2c7eb81702efd9.tar.gz cpython-72b710a59617ebe6dd1c41613d2c7eb81702efd9.tar.bz2 |
Renamed PyString to PyBytes
Diffstat (limited to 'Modules/_gdbmmodule.c')
-rw-r--r-- | Modules/_gdbmmodule.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c index 4404d2f..6c75819 100644 --- a/Modules/_gdbmmodule.c +++ b/Modules/_gdbmmodule.c @@ -130,7 +130,7 @@ dbm_subscript(dbmobject *dp, register PyObject *key) PyErr_SetObject(PyExc_KeyError, key); return NULL; } - v = PyString_FromStringAndSize(drec.dptr, drec.dsize); + v = PyBytes_FromStringAndSize(drec.dptr, drec.dsize); free(drec.dptr); return v; } @@ -220,7 +220,7 @@ dbm_keys(register dbmobject *dp, PyObject *unused) key = gdbm_firstkey(dp->di_dbm); while (key.dptr) { - item = PyString_FromStringAndSize(key.dptr, key.dsize); + item = PyBytes_FromStringAndSize(key.dptr, key.dsize); if (item == NULL) { free(key.dptr); Py_DECREF(v); @@ -251,14 +251,14 @@ dbm_contains(PyObject *self, PyObject *arg) "GDBM object has already been closed"); return -1; } - if (!PyString_Check(arg)) { + if (!PyBytes_Check(arg)) { PyErr_Format(PyExc_TypeError, "gdbm key must be bytes, 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); return gdbm_exists(dp->di_dbm, key); } @@ -291,7 +291,7 @@ dbm_firstkey(register dbmobject *dp, PyObject *unused) check_dbmobject_open(dp); key = gdbm_firstkey(dp->di_dbm); if (key.dptr) { - v = PyString_FromStringAndSize(key.dptr, key.dsize); + v = PyBytes_FromStringAndSize(key.dptr, key.dsize); free(key.dptr); return v; } @@ -323,7 +323,7 @@ dbm_nextkey(register dbmobject *dp, PyObject *args) check_dbmobject_open(dp); nextkey = gdbm_nextkey(dp->di_dbm, key); if (nextkey.dptr) { - v = PyString_FromStringAndSize(nextkey.dptr, nextkey.dsize); + v = PyBytes_FromStringAndSize(nextkey.dptr, nextkey.dsize); free(nextkey.dptr); return v; } |