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/_lsprof.c b/Modules/_lsprof.c
index 2b80a00..5d18c33 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -179,8 +179,8 @@
/* built-in function: look up the module name */
PyObject *mod = fn->m_module;
char *modname;
- if (mod && PyBytes_Check(mod)) {
- modname = PyBytes_AS_STRING(mod);
+ if (mod && PyString_Check(mod)) {
+ modname = PyString_AS_STRING(mod);
}
else if (mod && PyModule_Check(mod)) {
modname = PyModule_GetName(mod);
@@ -193,11 +193,11 @@
modname = "__builtin__";
}
if (strcmp(modname, "__builtin__") != 0)
- return PyBytes_FromFormat("<%s.%s>",
+ return PyString_FromFormat("<%s.%s>",
modname,
fn->m_ml->ml_name);
else
- return PyBytes_FromFormat("<%s>",
+ return PyString_FromFormat("<%s>",
fn->m_ml->ml_name);
}
else {
@@ -205,7 +205,7 @@
repr(getattr(type(__self__), __name__))
*/
PyObject *self = fn->m_self;
- PyObject *name = PyBytes_FromString(fn->m_ml->ml_name);
+ PyObject *name = PyString_FromString(fn->m_ml->ml_name);
if (name != NULL) {
PyObject *mo = _PyType_Lookup(Py_TYPE(self), name);
Py_XINCREF(mo);
@@ -218,7 +218,7 @@
}
}
PyErr_Clear();
- return PyBytes_FromFormat("<built-in method %s>",
+ return PyString_FromFormat("<built-in method %s>",
fn->m_ml->ml_name);
}
}