summaryrefslogtreecommitdiffstats
path: root/Modules/_hotshot.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-06-09 04:58:54 (GMT)
commitdd96db63f689e2f0d8ae5a1436b3b3395eec7de5 (patch)
treeb2299acac9ce44fc488fc7b2ae2a44548cd5fbb8 /Modules/_hotshot.c
parente98839a1f48b2915f1cc747884e64f4d6e4c8e7a (diff)
downloadcpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.zip
cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.gz
cpython-dd96db63f689e2f0d8ae5a1436b3b3395eec7de5.tar.bz2
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 'Modules/_hotshot.c')
-rw-r--r--Modules/_hotshot.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
index 7c8bdd9..4c66e2a 100644
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -326,7 +326,7 @@ unpack_string(LogReaderObject *self, PyObject **pvalue)
return ERR_EOF;
}
}
- *pvalue = PyBytes_FromStringAndSize(buf, len);
+ *pvalue = PyString_FromStringAndSize(buf, len);
free(buf);
if (*pvalue == NULL) {
return ERR_EXCEPTION;
@@ -562,7 +562,7 @@ flush_data(ProfilerObject *self)
self->index - written);
self->index -= written;
if (written == 0) {
- char *s = PyBytes_AsString(self->logfilename);
+ char *s = PyString_AsString(self->logfilename);
PyErr_SetFromErrnoWithFilename(PyExc_IOError, s);
do_stop(self);
return -1;
@@ -570,7 +570,7 @@ flush_data(ProfilerObject *self)
}
if (written > 0) {
if (fflush(self->logfp)) {
- char *s = PyBytes_AsString(self->logfilename);
+ char *s = PyString_AsString(self->logfilename);
PyErr_SetFromErrnoWithFilename(PyExc_IOError, s);
do_stop(self);
return -1;
@@ -792,7 +792,7 @@ get_fileno(ProfilerObject *self, PyCodeObject *fcode)
self->next_fileno++;
Py_DECREF(obj);
if (pack_define_file(self, fileno,
- PyBytes_AS_STRING(fcode->co_filename)) < 0)
+ PyString_AS_STRING(fcode->co_filename)) < 0)
return -1;
}
else {
@@ -810,7 +810,7 @@ get_fileno(ProfilerObject *self, PyCodeObject *fcode)
PyObject *name = PyDict_GetItem(dict, obj);
if (name == NULL) {
if (pack_define_func(self, fileno, fcode->co_firstlineno,
- PyBytes_AS_STRING(fcode->co_name)) < 0) {
+ PyString_AS_STRING(fcode->co_name)) < 0) {
Py_DECREF(obj);
return -1;
}
@@ -1471,7 +1471,7 @@ write_header(ProfilerObject *self)
len = PyList_GET_SIZE(temp);
for (i = 0; i < len; ++i) {
PyObject *item = PyList_GET_ITEM(temp, i);
- buffer = PyBytes_AsString(item);
+ buffer = PyString_AsString(item);
if (buffer == NULL) {
pack_add_info(self, "sys-path-entry", "<non-string-path-entry>");
PyErr_Clear();