Renamed PyString to PyBytes
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 9b3ff3e..cda8a40 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -81,7 +81,7 @@
result = PyEval_CallObject(reader, args);
Py_DECREF(reader);
Py_DECREF(args);
- if (result != NULL && !PyString_Check(result) &&
+ if (result != NULL && !PyBytes_Check(result) &&
!PyUnicode_Check(result)) {
Py_DECREF(result);
result = NULL;
@@ -90,9 +90,9 @@
}
}
- if (n < 0 && result != NULL && PyString_Check(result)) {
- char *s = PyString_AS_STRING(result);
- Py_ssize_t len = PyString_GET_SIZE(result);
+ if (n < 0 && result != NULL && PyBytes_Check(result)) {
+ char *s = PyBytes_AS_STRING(result);
+ Py_ssize_t len = PyBytes_GET_SIZE(result);
if (len == 0) {
Py_DECREF(result);
result = NULL;
@@ -101,10 +101,10 @@
}
else if (s[len-1] == '\n') {
if (result->ob_refcnt == 1)
- _PyString_Resize(&result, len-1);
+ _PyBytes_Resize(&result, len-1);
else {
PyObject *v;
- v = PyString_FromStringAndSize(s, len-1);
+ v = PyBytes_FromStringAndSize(s, len-1);
Py_DECREF(result);
result = v;
}