summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/file/_Filemodule.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 /Mac/Modules/file/_Filemodule.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 'Mac/Modules/file/_Filemodule.c')
-rw-r--r--Mac/Modules/file/_Filemodule.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c
index 352ef64..a314e5b 100644
--- a/Mac/Modules/file/_Filemodule.c
+++ b/Mac/Modules/file/_Filemodule.c
@@ -961,7 +961,7 @@ static PyObject *Alias_get_data(AliasObject *self, void *closure)
size = GetHandleSize((Handle)self->ob_itself);
HLock((Handle)self->ob_itself);
- rv = PyBytes_FromStringAndSize(*(Handle)self->ob_itself, size);
+ rv = PyString_FromStringAndSize(*(Handle)self->ob_itself, size);
HUnlock((Handle)self->ob_itself);
return rv;
@@ -1362,7 +1362,7 @@ static PyObject *FSSpec_as_pathname(FSSpecObject *_self, PyObject *_args)
PyMac_Error(err);
return NULL;
}
- _res = PyBytes_FromString(strbuf);
+ _res = PyString_FromString(strbuf);
return _res;
}
@@ -1419,7 +1419,7 @@ static PyMethodDef FSSpec_methods[] = {
static PyObject *FSSpec_get_data(FSSpecObject *self, void *closure)
{
- return PyBytes_FromStringAndSize((char *)&self->ob_itself, sizeof(self->ob_itself));
+ return PyString_FromStringAndSize((char *)&self->ob_itself, sizeof(self->ob_itself));
}
#define FSSpec_set_data NULL
@@ -1440,7 +1440,7 @@ static PyObject * FSSpec_repr(FSSpecObject *self)
self->ob_itself.vRefNum,
self->ob_itself.parID,
self->ob_itself.name[0], self->ob_itself.name+1);
- return PyBytes_FromString(buf);
+ return PyString_FromString(buf);
}
#define FSSpec_hash NULL
@@ -2015,7 +2015,7 @@ static PyMethodDef FSRef_methods[] = {
static PyObject *FSRef_get_data(FSRefObject *self, void *closure)
{
- return PyBytes_FromStringAndSize((char *)&self->ob_itself, sizeof(self->ob_itself));
+ return PyString_FromStringAndSize((char *)&self->ob_itself, sizeof(self->ob_itself));
}
#define FSRef_set_data NULL
@@ -3131,7 +3131,7 @@ static PyObject *File_pathname(PyObject *_self, PyObject *_args)
if (!PyArg_ParseTuple(_args, "O", &obj))
return NULL;
- if (PyBytes_Check(obj)) {
+ if (PyString_Check(obj)) {
Py_INCREF(obj);
return obj;
}
@@ -3301,7 +3301,7 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
}
/* On OSX we now try a pathname */
- if ( PyBytes_Check(v) || PyUnicode_Check(v)) {
+ if ( PyString_Check(v) || PyUnicode_Check(v)) {
char *path = NULL;
if (!PyArg_Parse(v, "et", Py_FileSystemDefaultEncoding, &path))
return 0;