summaryrefslogtreecommitdiff
path: root/Objects/methodobject.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 +0000
committerGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 +0000
commitdd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch)
treeb2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /Objects/methodobject.c
parente98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff)
downloadcpython-git-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.gz
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.
Diffstat (limited to 'Objects/methodobject.c')
-rw-r--r--Objects/methodobject.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 57ab5c51d4..737a3f780e 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -149,7 +149,7 @@ meth_get__doc__(PyCFunctionObject *m, void *closure)
const char *doc = m->m_ml->ml_doc;
if (doc != NULL)
- return PyBytes_FromString(doc);
+ return PyString_FromString(doc);
Py_INCREF(Py_None);
return Py_None;
}
@@ -157,7 +157,7 @@ meth_get__doc__(PyCFunctionObject *m, void *closure)
static PyObject *
meth_get__name__(PyCFunctionObject *m, void *closure)
{
- return PyBytes_FromString(m->m_ml->ml_name);
+ return PyString_FromString(m->m_ml->ml_name);
}
static int
@@ -202,9 +202,9 @@ static PyObject *
meth_repr(PyCFunctionObject *m)
{
if (m->m_self == NULL)
- return PyBytes_FromFormat("<built-in function %s>",
+ return PyString_FromFormat("<built-in function %s>",
m->m_ml->ml_name);
- return PyBytes_FromFormat("<built-in method %s of %s object at %p>",
+ return PyString_FromFormat("<built-in method %s of %s object at %p>",
m->m_ml->ml_name,
m->m_self->ob_type->tp_name,
m->m_self);
@@ -333,7 +333,7 @@ listmethodchain(PyMethodChain *chain)
i = 0;
for (c = chain; c != NULL; c = c->link) {
for (ml = c->methods; ml->ml_name != NULL; ml++) {
- PyList_SetItem(v, i, PyBytes_FromString(ml->ml_name));
+ PyList_SetItem(v, i, PyString_FromString(ml->ml_name));
i++;
}
}
@@ -360,7 +360,7 @@ Py_FindMethodInChain(PyMethodChain *chain, PyObject *self, const char *name)
if (strcmp(name, "__doc__") == 0) {
const char *doc = self->ob_type->tp_doc;
if (doc != NULL)
- return PyBytes_FromString(doc);
+ return PyString_FromString(doc);
}
}
while (chain != NULL) {