More reverting of r63675 per the mailing list discussions. This restores

occurances of PyBytes_ in the code to their original PyString_ names.  The
bytesobject.c file will be renamed back to stringobject.c in a future checkin.
This commit is contained in:
Gregory P. Smith 2008-06-10 17:42:36 +00:00
parent b67b53db51
commit 99a3dce92d
3 changed files with 481 additions and 481 deletions

View File

@ -1207,9 +1207,9 @@ wrap_strftime(PyObject *object, const char *format, size_t format_len,
* is expensive, don't unless they're actually used. * is expensive, don't unless they're actually used.
*/ */
totalnew = format_len + 1; /* realistic if no %z/%Z/%f */ totalnew = format_len + 1; /* realistic if no %z/%Z/%f */
newfmt = PyBytes_FromStringAndSize(NULL, totalnew); newfmt = PyString_FromStringAndSize(NULL, totalnew);
if (newfmt == NULL) goto Done; if (newfmt == NULL) goto Done;
pnew = PyBytes_AsString(newfmt); pnew = PyString_AsString(newfmt);
usednew = 0; usednew = 0;
pin = format; pin = format;

File diff suppressed because it is too large Load Diff

View File

@ -453,7 +453,7 @@ PyFile_SetEncodingAndErrors(PyObject *f, const char *enc, char* errors)
PyObject *str, *oerrors; PyObject *str, *oerrors;
assert(PyFile_Check(f)); assert(PyFile_Check(f));
str = PyBytes_FromString(enc); str = PyString_FromString(enc);
if (!str) if (!str)
return 0; return 0;
if (errors) { if (errors) {
@ -2321,9 +2321,9 @@ PyFile_WriteObject(PyObject *v, PyObject *f, int flags)
#ifdef Py_USING_UNICODE #ifdef Py_USING_UNICODE
if ((flags & Py_PRINT_RAW) && if ((flags & Py_PRINT_RAW) &&
PyUnicode_Check(v) && enc != Py_None) { PyUnicode_Check(v) && enc != Py_None) {
char *cenc = PyBytes_AS_STRING(enc); char *cenc = PyString_AS_STRING(enc);
char *errors = fobj->f_errors == Py_None ? char *errors = fobj->f_errors == Py_None ?
"strict" : PyBytes_AS_STRING(fobj->f_errors); "strict" : PyString_AS_STRING(fobj->f_errors);
value = PyUnicode_AsEncodedString(v, cenc, errors); value = PyUnicode_AsEncodedString(v, cenc, errors);
if (value == NULL) if (value == NULL)
return -1; return -1;