This reverts r63675 based on the discussion in this thread:
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
diff --git a/Modules/readline.c b/Modules/readline.c
index f988d50..90904ab 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -421,7 +421,7 @@
static PyObject *
get_completer_delims(PyObject *self, PyObject *noarg)
{
- return PyBytes_FromString(rl_completer_word_break_characters);
+ return PyString_FromString(rl_completer_word_break_characters);
}
PyDoc_STRVAR(doc_get_completer_delims,
@@ -471,7 +471,7 @@
if (!PyArg_ParseTuple(args, "i:index", &idx))
return NULL;
if ((hist_ent = history_get(idx)))
- return PyBytes_FromString(hist_ent->line);
+ return PyString_FromString(hist_ent->line);
else {
Py_RETURN_NONE;
}
@@ -503,7 +503,7 @@
static PyObject *
get_line_buffer(PyObject *self, PyObject *noarg)
{
- return PyBytes_FromString(rl_line_buffer);
+ return PyString_FromString(rl_line_buffer);
}
PyDoc_STRVAR(doc_get_line_buffer,
@@ -676,7 +676,7 @@
if (m == NULL)
goto error;
for (i = 0; i < num_matches; i++) {
- s = PyBytes_FromString(matches[i+1]);
+ s = PyString_FromString(matches[i+1]);
if (s == NULL)
goto error;
if (PyList_SetItem(m, i, s) == -1)
@@ -725,7 +725,7 @@
result = NULL;
}
else {
- char *s = PyBytes_AsString(r);
+ char *s = PyString_AsString(r);
if (s == NULL)
goto error;
result = strdup(s);